-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathplaywright.docker.config.ts
More file actions
49 lines (45 loc) · 1.31 KB
/
playwright.docker.config.ts
File metadata and controls
49 lines (45 loc) · 1.31 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
import { PlaywrightTestConfig, devices } from '@playwright/test'
import { Fixtures } from './e2e/base-test'
/**
* Playwright configuration for testing Docker/Kamal deployments
*
* Usage:
* npm run test:e2e:docker # Test local Docker container (localhost:3000)
* npm run test:e2e:production # Test production (kelas.rumahberbagi.com)
* DOCKER_URL=http://host:port npm run test:e2e:docker # Custom URL
*
* This config differs from the main config:
* - Uses DOCKER_URL env var for flexible target URLs
* - No test server (expects container already running)
* - Reduced test parallelism for stability
* - Smoke tests subset by default (can be overridden)
*/
const baseURL =
process.env.DOCKER_URL || process.env.BASE_URL || 'http://localhost:3000'
const config: PlaywrightTestConfig<Fixtures> = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
testDir: './e2e',
globalTimeout: 10 * 60 * 1000,
timeout: 30000,
workers: 2,
use: {
trace: 'on-first-retry',
baseURL,
screenshot: 'only-on-failure',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'mobile',
use: {
browserName: 'chromium',
...devices['Pixel 4'],
},
},
],
}
export default config