-
-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(counters_stable): add missing e2e tests (#1251)
* test(counters_stable): remove unused ids * test(counters_stable): enter count * refactor(counters_stable/e2e): improve test names * refactor(counters_stable): move page object * refactor(counters_stable/e2e): target nth counter * test(counters_stable): remove counter * refactor(counters_stable/e2e): change description
- Loading branch information
Showing
10 changed files
with
92 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { CountersPage } from "./fixtures/counters_page"; | ||
|
||
test.describe("Enter Count", () => { | ||
test("should increase the total count", async ({ page }) => { | ||
const ui = new CountersPage(page); | ||
await ui.goto(); | ||
await ui.addCounter(); | ||
|
||
await ui.enterCount("5"); | ||
|
||
await expect(ui.total).toHaveText("5"); | ||
await expect(ui.counters).toHaveText("1"); | ||
}); | ||
|
||
test("should decrease the total count", async ({ page }) => { | ||
const ui = new CountersPage(page); | ||
await ui.goto(); | ||
await ui.addCounter(); | ||
await ui.addCounter(); | ||
await ui.addCounter(); | ||
|
||
await ui.enterCount("100"); | ||
await ui.enterCount("100", 1); | ||
await ui.enterCount("100", 2); | ||
await ui.enterCount("50", 1); | ||
|
||
await expect(ui.total).toHaveText("250"); | ||
await expect(ui.counters).toHaveText("3"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { CountersPage } from "./fixtures/counters_page"; | ||
|
||
test.describe("Remove Counter", () => { | ||
test("should decrement the number of counters", async ({ page }) => { | ||
const ui = new CountersPage(page); | ||
await ui.goto(); | ||
|
||
await ui.addCounter(); | ||
await ui.addCounter(); | ||
await ui.addCounter(); | ||
|
||
await ui.removeCounter(1); | ||
|
||
await expect(ui.total).toHaveText("0"); | ||
await expect(ui.counters).toHaveText("2"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters