- Step timeout 900→1800s to accommodate 34 tests across 5 projects - Remove test 06 (dashboard pages) from cross-browser specs — each subtest creates a wallet context, making 4× browser runs too slow - Cross-browser now runs 03 (GraphQL verification) + 07 (landing pages) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
85 lines
2.5 KiB
TypeScript
85 lines
2.5 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
||
|
||
/**
|
||
* Cross-browser + mobile viewport matrix for E2E quality gate.
|
||
*
|
||
* - `chromium` runs ALL numbered specs (01-07) including transactional tests
|
||
* that mutate on-chain state.
|
||
* - Other projects depend on `chromium` finishing first (chain state must exist)
|
||
* and only run read-only / UI-rendering specs (03, 06, 07).
|
||
*/
|
||
|
||
// Lightweight read-only specs for cross-browser/viewport validation.
|
||
// Test 06 (dashboard pages) is excluded because each subtest creates a wallet
|
||
// context, making it too slow for 4× additional browser runs in CI.
|
||
const CROSS_BROWSER_SPECS = '0[37]-*.spec.ts';
|
||
|
||
// Chromium-specific launch flags (not valid for Firefox/WebKit).
|
||
const CHROMIUM_ARGS = ['--disable-dev-shm-usage', '--no-sandbox'];
|
||
|
||
export default defineConfig({
|
||
testDir: './tests/e2e',
|
||
testMatch: process.env.CI ? '[0-9]*.spec.ts' : '**/*.spec.ts',
|
||
fullyParallel: false,
|
||
timeout: 10 * 60 * 1000,
|
||
expect: {
|
||
timeout: 30_000,
|
||
},
|
||
retries: process.env.CI ? 1 : 0,
|
||
workers: process.env.CI ? 1 : undefined,
|
||
use: {
|
||
headless: true,
|
||
actionTimeout: 0,
|
||
},
|
||
projects: [
|
||
/* ── Desktop browsers ─────────────────────────────────── */
|
||
{
|
||
name: 'chromium',
|
||
use: {
|
||
...devices['Desktop Chrome'],
|
||
viewport: { width: 1280, height: 720 },
|
||
screen: { width: 1280, height: 720 },
|
||
launchOptions: { args: CHROMIUM_ARGS },
|
||
},
|
||
},
|
||
{
|
||
name: 'firefox',
|
||
use: {
|
||
...devices['Desktop Firefox'],
|
||
viewport: { width: 1280, height: 720 },
|
||
screen: { width: 1280, height: 720 },
|
||
},
|
||
dependencies: ['chromium'],
|
||
testMatch: CROSS_BROWSER_SPECS,
|
||
},
|
||
{
|
||
name: 'webkit',
|
||
use: {
|
||
...devices['Desktop Safari'],
|
||
viewport: { width: 1280, height: 720 },
|
||
screen: { width: 1280, height: 720 },
|
||
},
|
||
dependencies: ['chromium'],
|
||
testMatch: CROSS_BROWSER_SPECS,
|
||
},
|
||
|
||
/* ── Mobile viewports ─────────────────────────────────── */
|
||
{
|
||
name: 'iphone',
|
||
use: {
|
||
...devices['iPhone 14'],
|
||
},
|
||
dependencies: ['chromium'],
|
||
testMatch: CROSS_BROWSER_SPECS,
|
||
},
|
||
{
|
||
name: 'android',
|
||
use: {
|
||
...devices['Pixel 7'],
|
||
launchOptions: { args: CHROMIUM_ARGS },
|
||
},
|
||
dependencies: ['chromium'],
|
||
testMatch: CROSS_BROWSER_SPECS,
|
||
},
|
||
],
|
||
});
|