Repository navigation
Expand file tree
/
Copy pathplaywright.config.js
More file actions
47 lines (43 loc) · 2.01 KB
/
Copy pathplaywright.config.js
File metadata and controls
47 lines (43 loc) · 2.01 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
'use strict';
// Playwright config for the EmailEngine happy-path e2e suite (test/e2e). Boots a fresh
// EmailEngine via the webServer command (flush the isolated Redis db 14, then `node server.js`
// with NODE_ENV=e2e -> config/e2e.toml) and drives it with a real browser.
//
// Run once: npm run test:e2e:install (fetch the Chromium browser)
// Run suite: npm run test:e2e
//
// A single spec can be run on its own (`npx playwright test pages-admin`), but tests that need
// the account happy-path.spec.js registers then fail; set EE_E2E_STANDALONE=1 to skip them.
const { defineConfig, devices } = require('@playwright/test');
const { BASE_URL } = require('./test/e2e/helpers/bootstrap');
module.exports = defineConfig({
testDir: './test/e2e',
testMatch: '**/*.spec.js',
// One worker against one app + one database keeps the fresh-instance flow predictable.
fullyParallel: false,
workers: 1,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
// The single happy-path test chains several slow external steps (Ethereal provisioning,
// trial activation against postalsys.com, IMAP connect, message read-back).
timeout: 300000,
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'list',
use: {
baseURL: BASE_URL,
trace: 'on-first-retry'
},
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
webServer: {
// Flush the isolated e2e Redis DB so every run starts from a clean, unconfigured instance.
command: 'node test/helpers/flush-redis.js && node server.js',
url: BASE_URL,
timeout: 120000,
// Always boot fresh: the suite asserts fresh-instance behaviour (enabling auth, activating
// the trial), so a reused server with those already set would break it. The dedicated
// db 14 makes the pre-boot flush safe.
reuseExistingServer: false,
stdout: 'pipe',
stderr: 'pipe',
env: Object.assign({}, process.env, { NODE_ENV: 'e2e' })
}
});