Repository navigation
Expand file tree
/
Copy pathplaywright.hit-test-app.config.ts
More file actions
65 lines (61 loc) · 2.09 KB
/
Copy pathplaywright.hit-test-app.config.ts
File metadata and controls
65 lines (61 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { defineConfig, devices } from "@playwright/test";
/**
* App-level hit-test offset harness (#1569) — real app, Dexie preview, no backend.
*
* Serves the pre-built ``frontend/dist/`` via ``vite preview`` (the GH-Pages
* shape the bug is reported on) and runs hit-test-app.spec.ts against real
* routes. Prerequisite: the caller built ``dist/`` with
* ``VITE_STORAGE_MODE=dexie`` — ``make test-hit-test-app`` does this.
*
* The pre-installed Chromium may differ from this Playwright pin; set
* ``PW_CHROMIUM_EXECUTABLE`` to launch it instead of downloading a match.
*/
const PREVIEW_PORT =
Number(process.env.ADAPTIVE_LEARNER_DEXIE_PREVIEW_PORT) || 4173;
const EXECUTABLE = process.env.PW_CHROMIUM_EXECUTABLE;
const LAUNCH = EXECUTABLE ? { executablePath: EXECUTABLE } : undefined;
export default defineConfig({
// #3439 - a committed test.only would run one test and report green.
forbidOnly: !!process.env.CI,
testDir: "./hit-test",
testMatch: /hit-test-app\.spec\.ts$/,
fullyParallel: false,
workers: 1,
retries: 0,
timeout: 60_000,
reporter: [["list"]],
use: {
baseURL: `http://localhost:${PREVIEW_PORT}`,
actionTimeout: 15_000,
trace: "on-first-retry",
// Seed German + grid view so the app renders deterministically (same
// reasoning as playwright.dexie.config.ts).
storageState: {
cookies: [],
origins: [
{
origin: `http://localhost:${PREVIEW_PORT}`,
localStorage: [
{ name: "adaptive-learner.content_view_mode", value: "grid" },
{ name: "adaptive-learner.language", value: "de" },
],
},
],
},
},
webServer: [
{
command: `cd ../frontend && npx vite preview --port ${PREVIEW_PORT} --strictPort`,
url: `http://localhost:${PREVIEW_PORT}`,
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
],
projects: [
{ name: "chromium", use: { browserName: "chromium", launchOptions: LAUNCH } },
{
name: "mobile-chromium",
use: { ...devices["Pixel 7"], browserName: "chromium", launchOptions: LAUNCH },
},
],
});