Repository navigation
Expand file tree
/
Copy pathplaywright.config.js
More file actions
69 lines (56 loc) · 1.68 KB
/
Copy pathplaywright.config.js
File metadata and controls
69 lines (56 loc) · 1.68 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
66
67
68
69
/**
* Playwright Configuration for WebSSH2 WebSocket Tests
*/
import { defineConfig, devices } from '@playwright/test'
export default defineConfig({
testDir: './tests/playwright',
// Maximum time one test can run for
timeout: 30 * 1000,
// Test execution settings
fullyParallel: false, // Run tests sequentially to avoid port conflicts
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1, // Single worker to avoid concurrent SSH connections
// Reporter configuration
reporter: [['html', { outputFolder: 'playwright-report' }], ['list']],
// Shared settings for all projects
use: {
// Base URL for the application
baseURL: 'http://localhost:2222',
// Collect trace when retrying the failed test
trace: 'on-first-retry',
// Screenshot on failure
screenshot: 'only-on-failure',
// Video on failure
video: 'retain-on-failure',
// Timeout for actions
actionTimeout: 10000,
// Navigation timeout
navigationTimeout: 30000,
},
// Configure projects for different browsers
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
// Web server configuration
// Commented out - run server manually before tests
// webServer: {
// command: 'NODE_ENV=development node index.js', // WebSocket is now default
// url: 'http://localhost:2222',
// reuseExistingServer: true, // Always try to reuse existing server
// timeout: 120 * 1000,
// stdout: 'pipe',
// stderr: 'pipe',
// },
})