Skip to content

Commit ef6cfbc

Browse files
committed
chore: fix more of the tests
1 parent 11da5cd commit ef6cfbc

File tree

7 files changed

+20
-23
lines changed

7 files changed

+20
-23
lines changed

basic/0-failing.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from "@playwright/test";
22
import { test } from "./base.ts";
33

44
test("basic test @basic", async ({ page }) => {
5-
await page.goto("https://todomvc.com/examples/backbone/dist/");
5+
await page.goto("https://demo.playwright.dev/todomvc");
66

77
// Use locators to represent a selector and re-use them
88
const inputBox = page.locator("input.new-todo");

basic/1-getting-started.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from "@playwright/test";
22
import { test } from "./base.ts";
33

44
test("basic test @basic", async ({ page }) => {
5-
await page.goto("https://todomvc.com/examples/backbone/dist/");
5+
await page.goto("https://demo.playwright.dev/todomvc");
66

77
// Use locators to represent a selector and re-use them
88
const inputBox = page.locator("input.new-todo");

basic/3-assertions.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from "@playwright/test";
22
import { test } from "./base.ts";
33

44
test.beforeEach(async ({ page }) => {
5-
await page.goto("https://todomvc.com/examples/backbone/dist/");
5+
await page.goto("https://demo.playwright.dev/todomvc");
66
});
77

88
/**
@@ -11,8 +11,8 @@ test.beforeEach(async ({ page }) => {
1111
*/
1212
test("should be able to use assertions", async ({ page }) => {
1313
await test.step("toHaveTitle/toHaveURL", async () => {
14-
await expect(page).toHaveTitle("TodoMVC: Backbone");
15-
await expect(page).toHaveURL("https://todomvc.com/examples/backbone/dist/");
14+
await expect(page).toHaveTitle("React • TodoMVC");
15+
await expect(page).toHaveURL(/^https:\/\/demo.playwright.dev\/todomvc/);
1616
});
1717

1818
await test.step("toBeEmpty/toHaveValue", async () => {
@@ -46,11 +46,9 @@ test("should be able to use assertions", async ({ page }) => {
4646
await expect(page.locator("text=Buy milk")).toBeHidden();
4747
});
4848

49-
await test.step("toHaveClass/toHaveCSS", async () => {
49+
await test.step("toHaveClass", async () => {
5050
await expect(
5151
page.locator('[placeholder="What needs to be done?"]')
5252
).toHaveClass("new-todo");
53-
await page.click("text=Clear completed");
54-
await expect(page.locator(".main")).toHaveCSS("display", "none");
5553
});
5654
});

basic/8-rules.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { test } from "./base.ts";
1111
* This is a failing test that will be quarantined by the file based rule
1212
*/
1313
test("rules quarantine test", async ({ page }) => {
14-
await page.goto("https://todomvc.com/examples/backbone/dist/");
14+
await page.goto("https://demo.playwright.dev/todomvc");
1515

1616
// Use locators to represent a selector and re-use them
1717
const inputBox = page.locator("input.new-todo");
@@ -26,7 +26,7 @@ test("rules quarantine test", async ({ page }) => {
2626
* This tests will be completely skipped by a rule that matches fileName + test name
2727
*/
2828
test("rules skip test", async ({ page }) => {
29-
await page.goto("https://todomvc.com/examples/backbone/dist/");
29+
await page.goto("https://demo.playwright.dev/todomvc");
3030

3131
// Use locators to represent a selector and re-use them
3232
const inputBox = page.locator("input.new-todo");

basic/base.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
2-
CurrentsFixtures,
3-
CurrentsWorkerFixtures,
4-
fixtures,
5-
} from "@currents/playwright";
6-
import { test as base } from "@playwright/test";
7-
8-
export const test = base.extend<CurrentsFixtures, CurrentsWorkerFixtures>({
9-
...fixtures.baseFixtures,
10-
...fixtures.rulesFixtures,
11-
});
2+
CurrentsFixtures,
3+
CurrentsWorkerFixtures,
4+
fixtures,
5+
} from "@currents/playwright";
6+
import { test as base } from "@playwright/test";
7+
8+
export const test = base.extend<CurrentsFixtures, CurrentsWorkerFixtures>({
9+
...fixtures.baseFixtures,
10+
...fixtures.rulesFixtures,
11+
});

basic/pom/todoPage.pom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ export class TodoPage {
2525
}
2626

2727
async goto() {
28-
await this.page.goto("https://todomvc.com/examples/backbone/dist/");
28+
await this.page.goto("https://demo.playwright.dev/todomvc");
2929
}
3030
}

basic/pw.config.shared.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const config = defineConfig<CurrentsFixtures, CurrentsWorkerFixtures>({
1515
workers: process.env.CI ? 1 : undefined,
1616

1717
use: {
18-
baseURL: process.env.BASEURL || "http://localhost:4346",
1918
actionTimeout: 0,
2019
trace: "on",
2120
video: "on",
@@ -41,7 +40,7 @@ const config = defineConfig<CurrentsFixtures, CurrentsWorkerFixtures>({
4140

4241
webServer: {
4342
command: 'node ./server/index.js',
44-
url: 'http://127.0.0.1:4346',
43+
port: 4346,
4544
reuseExistingServer: !process.env.CI,
4645
stdout: 'ignore',
4746
stderr: 'pipe',

0 commit comments

Comments
 (0)