Skip to content

Commit 9b04f90

Browse files
committed
Update playwright settings
1 parent 9a8c600 commit 9b04f90

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ test-e2e-sqlite: build generate-ini-sqlite
524524
test-e2e-sqlite\#%: GOFLAGS+=sqlite sqlite_unlock_notify
525525
test-e2e-sqlite\#%: build generate-ini-sqlite
526526
npx playwright install $(PLAYWRIGHT_FLAGS)
527-
GITEA_ROOT=$(CURDIR) GITEA_EXECUTABLE=$(EXECUTABLE)GITEA_CONF=integrations/sqlite.ini E2E_TESTS=$* ./tools/e2e/run_e2e.sh
527+
GITEA_ROOT=$(CURDIR) GITEA_EXECUTABLE=$(EXECUTABLE) GITEA_CONF=integrations/sqlite.ini E2E_TESTS=$* ./tools/e2e/run_e2e.sh
528528

529529
.PHONY: test-e2e-mysql8
530530
test-e2e-mysql8: build generate-ini-mysql8

playwright.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {devices} from '@playwright/test';
66
* @type {import('@playwright/test').PlaywrightTestConfig}
77
*/
88
const config = {
9-
testDir: './tools/e2e/tests',
9+
testDir: './tools/e2e/tests', // TODO: Change this to the ./web_src/ dir?
10+
testMatch: /.*\.test\.e2e\.js/, // Match any .test.e2e.js files
1011

1112
/* Maximum time one test can run for. */
1213
timeout: 30 * 1000,
@@ -41,6 +42,9 @@ const config = {
4142
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
4243
actionTimeout: 1000,
4344

45+
/* Maximum time allowed for navigation, such as `page.goto()`. */
46+
navigationTimeout: 5 * 1000,
47+
4448
/* Base URL to use in actions like `await page.goto('/')`. */
4549
baseURL: 'http://localhost:3000',
4650

tools/e2e/tests/example.spec.js

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// @ts-check
2+
import {test, expect} from '@playwright/test';
3+
4+
test('Load Homepage', async ({page}) => {
5+
const response = await page.goto('/');
6+
await expect(response.status()).toBe(200); // Status OK
7+
await expect(page).toHaveTitle(/^Gitea: Test\s*$/);
8+
await expect(page.locator('.logo')).toHaveAttribute('src', '/assets/img/logo.svg');
9+
});

0 commit comments

Comments
 (0)