mirror of
https://github.com/sol1/rustguac.git
synced 2026-10-26 21:47:27 +00:00
c934065a84
A browser test harness under tests/e2e: serve.mjs serves the real static
tree over HTTP and lib/api.mjs answers /api/* from a small fixture address
book, recording every request the page makes, so the shipped pages run
against data the test controls without Vault, guacd or a session. CI gains
an e2e job that installs Chromium and runs the suite.
The first spec pins #252: at 1710px the connections, recordings and reports
tables fit inside the viewport and nothing scrolls sideways.
(cherry picked from commit 4ae28efec0)
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
const PORT = process.env.E2E_PORT || '8098';
|
|
const baseURL = `http://127.0.0.1:${PORT}`;
|
|
|
|
export default defineConfig({
|
|
testDir: './specs',
|
|
timeout: 30_000,
|
|
expect: { timeout: 5_000 },
|
|
fullyParallel: true,
|
|
workers: process.env.CI ? 2 : undefined,
|
|
retries: process.env.CI ? 1 : 0,
|
|
reporter: process.env.CI ? [['list'], ['github']] : 'list',
|
|
use: {
|
|
baseURL,
|
|
colorScheme: 'dark',
|
|
// The 1710px MacBook display the layout issues were reported on.
|
|
viewport: { width: 1710, height: 1112 },
|
|
trace: 'retain-on-failure',
|
|
...(process.env.PW_CHROMIUM ? { launchOptions: { executablePath: process.env.PW_CHROMIUM } } : {})
|
|
},
|
|
webServer: {
|
|
command: `node serve.mjs ${PORT}`,
|
|
url: `${baseURL}/index.html`,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 20_000
|
|
},
|
|
projects: [
|
|
{ name: 'chromium', use: { ...devices['Desktop Chrome'], viewport: { width: 1710, height: 1112 } } }
|
|
]
|
|
});
|