-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.stage-local.config.ts
More file actions
70 lines (58 loc) · 1.75 KB
/
playwright.stage-local.config.ts
File metadata and controls
70 lines (58 loc) · 1.75 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
70
import { defineConfig, devices } from '@playwright/test';
import fs from 'fs';
import path from 'path';
// Load environment variables from .env file manually
const envPath = path.resolve(process.cwd(), '.env');
if (fs.existsSync(envPath)) {
const envContent = fs.readFileSync(envPath, 'utf-8');
for (const line of envContent.split('\n')) {
const trimmed = line.trim();
if (trimmed && !trimmed.startsWith('#')) {
const [key, ...valueParts] = trimmed.split('=');
const value = valueParts.join('=').replace(/^["']|["']$/g, '');
if (key && !process.env[key]) {
process.env[key] = value;
}
}
}
}
/**
* TEMPORARY: Stage test config pointing to LOCAL Docker environment.
* Use this to test the full workflow locally before deploying to Stage.
*/
export default defineConfig({
testDir: './tests/playwright/stage',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: 0,
workers: 1,
reporter: [
['html', { outputFolder: 'playwright-report-stage-local' }],
['list'],
],
timeout: 120 * 1000,
expect: {
timeout: 20 * 1000,
},
testMatch: '**/*.spec.ts',
use: {
/* LOCAL Docker environment instead of Stage */
baseURL: 'https://ernie.localhost:3333',
ignoreHTTPSErrors: true,
trace: 'retain-on-failure',
video: 'retain-on-failure',
screenshot: 'only-on-failure',
actionTimeout: 30 * 1000,
navigationTimeout: 60 * 1000,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});
// For local Docker testing, set credentials via environment variables:
// STAGE_TEST_USERNAME=test@example.com
// STAGE_TEST_PASSWORD=password
// These can be set in .env file or passed directly when running tests