-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathplaywright.smoke.config.ts
More file actions
50 lines (48 loc) · 1.17 KB
/
playwright.smoke.config.ts
File metadata and controls
50 lines (48 loc) · 1.17 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
import { defineConfig, devices } from "@playwright/test";
const smokeTestUrl = process.env.SMOKE_TEST_URL;
/**
* Playwright configuration for smoke tests.
*
* Two modes:
* - Local mode (no SMOKE_TEST_URL): builds locally and serves on port 4173
* - Deploy mode (SMOKE_TEST_URL set): tests against a live URL
*
* @example
* # Local/CI smoke tests (local build)
* npm run test:e2e:smoke
*
* # Test production
* SMOKE_TEST_URL=https://count.racku.la npm run test:e2e:smoke
*/
export default defineConfig({
testDir: "e2e",
testMatch: ["smoke.spec.ts", "basic-workflow.spec.ts"],
fullyParallel: true,
retries: 2,
timeout: 60000,
expect: {
timeout: 15000,
},
reporter: [["html", { open: "never" }]],
use: {
baseURL: smokeTestUrl || "http://localhost:4173",
trace: "on-first-retry",
screenshot: "only-on-failure",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
...(smokeTestUrl
? {}
: {
webServer: {
command: "npm run build && npm run preview",
port: 4173,
timeout: 120_000,
reuseExistingServer: !process.env.CI,
},
}),
});