-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,859 additions
and
562 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/.next | ||
/.env | ||
/build | ||
/test-results |
Large diffs are not rendered by default.
Oops, something went wrong.
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,24 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
|
||
import {PlaywrightTestConfig} from "@playwright/test" | ||
|
||
const isCI = !!process.env.CI | ||
|
||
const config: PlaywrightTestConfig = { | ||
forbidOnly: isCI, | ||
retries: isCI ? 2 : 0, | ||
testDir: "./tests", | ||
testMatch: /.*\.test\.ts/, | ||
use: { | ||
trace: "retain-on-failure", | ||
video: "on-first-retry" | ||
}, | ||
webServer: { | ||
command: "npm run start", | ||
port: 3000, | ||
timeout: 120 * 1000, | ||
reuseExistingServer: !isCI | ||
} | ||
} | ||
|
||
export default config |
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,21 @@ | ||
import {test, expect} from "@playwright/test" | ||
|
||
// Checking is counter works correctly | ||
test("server started correctly", async ({page}) => { | ||
await page.goto("/") | ||
|
||
const counterInc = "data-test=counter_inc" | ||
const counterDec = "data-test=counter_dec" | ||
const counterValue = page.locator("data-test=counter_value") | ||
|
||
expect(counterValue).toHaveText("0") | ||
await page.click(counterInc) | ||
expect(counterValue).toHaveText("1") | ||
await page.click(counterInc) | ||
expect(counterValue).toHaveText("2") | ||
|
||
await page.click(counterDec) | ||
expect(counterValue).toHaveText("1") | ||
await page.click(counterDec) | ||
expect(counterValue).toHaveText("0") | ||
}) |
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,9 @@ | ||
import {test, expect} from "@playwright/test" | ||
|
||
// Checking if the server has started (basic smoke test) | ||
test("server started correctly", async ({page}) => { | ||
await page.goto("/") | ||
const counterValue = page.locator("data-test=counter_value") | ||
|
||
expect(counterValue).toHaveText("0") | ||
}) |
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