Skip to content

Commit 371b599

Browse files
committed
ci: e2e login Refs: PS-276
1 parent 56e3bf0 commit 371b599

4 files changed

Lines changed: 29 additions & 21 deletions

File tree

e2e/tests/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export const login = async (page: Page, email: string, password: string) => {
66
await expect(page.locator('.login-pf-page')).toBeVisible();
77
await expect(page.locator('#kc-error-message')).toBeHidden();
88

9-
await page.getByLabel('Email').fill(email);
10-
await page.getByLabel('Password', { exact: true }).fill(password);
9+
await page.getByRole('textbox', { name: 'Email' }).fill(email);
10+
await page.getByRole('textbox', { name: 'Password' }).fill(password);
1111

12-
await page.getByRole('button', { name: 'Log in' }).click();
12+
await page.getByRole('button', { name: 'Log In' }).click();
1313
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"devDependencies": {
8787
"@commitlint/cli": "^20.5.0",
8888
"@commitlint/config-conventional": "^20.5.0",
89-
"@playwright/test": "^1.58.2",
89+
"@playwright/test": "^1.60.0",
9090
"@vitest/coverage-istanbul": "^4.1.2",
9191
"husky": "^4.2.3",
9292
"jsdom": "^26.1.0",

playwright.config.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@ import path from 'path';
66
* See https://playwright.dev/docs/test-configuration.
77
*/
88

9-
dotenv.config({ path: path.resolve(__dirname, '.env') });
9+
dotenv.config({ path: path.resolve(__dirname, '.env.local') });
1010

1111
export const TEST_USER_EMAIL = process.env.E2E_TEST_USER_EMAIL ?? '';
1212
export const TEST_USER_PASSWORD = process.env.E2E_TEST_USER_PASSWORD ?? '';
1313

1414
export default defineConfig({
1515
testDir: './e2e/tests/pages',
16+
17+
// Timeout for each test in milliseconds
18+
timeout: 90 * 1000,
19+
1620
/* Run tests in files in parallel */
1721
fullyParallel: true,
1822
/* Fail the build on CI if you accidentally left test.only in the source code. */
1923
forbidOnly: !!process.env.CI,
2024

2125
/* The maximum number of retry attempts given to failed tests */
22-
retries: process.env.CI ? 1 : undefined,
26+
retries: process.env.CI ? 2 : 1,
2327
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
2428
reporter: [
2529
['junit', { outputFile: 'report/e2e-junit-results.xml' }],
@@ -28,8 +32,7 @@ export default defineConfig({
2832
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2933
use: {
3034
/* Base URL to use in actions like `await page.goto('/')`. */
31-
baseURL:
32-
process.env.E2E_TESTS_ENV_URL ?? 'https://puistotalkoot.dev.hel.ninja/',
35+
baseURL: process.env.E2E_TESTS_ENV_URL ?? 'http://localhost:3000',
3336
ignoreHTTPSErrors: true,
3437
screenshot: {
3538
fullPage: true,
@@ -53,4 +56,9 @@ export default defineConfig({
5356
use: { ...devices['Desktop Firefox'] },
5457
},
5558
],
59+
webServer: {
60+
command: 'pnpm start',
61+
url: process.env.E2E_TESTS_ENV_URL ?? 'http://localhost:3000',
62+
reuseExistingServer: true,
63+
},
5664
});

pnpm-lock.yaml

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)