Add Playwright E2E suite against the built dist/
Pin @playwright/test 1.62.0 (matches the cached chromium revision) and serve dist/ via python3 http.server, so the deployed artifact is what gets tested. Covers page load, terminal commands, vim mode, achievements, and the nav menu. Ignore node_modules, test-results, playwright-report, and the phased-execution runtime scratch (.agents/phase-sessions, pipeline.log).
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
// @ts-check
|
||||
const { defineConfig } = require('@playwright/test');
|
||||
|
||||
/**
|
||||
* E2E config: serves the production build (dist/) on a local static server.
|
||||
* Always run `./build.sh` (npm run build) before `npm test` so the tests
|
||||
* exercise the exact artifact that gets deployed.
|
||||
*/
|
||||
module.exports = defineConfig({
|
||||
testDir: './tests/e2e',
|
||||
timeout: 20000,
|
||||
retries: 0,
|
||||
workers: 1,
|
||||
reporter: [['list'], ['html', { open: 'never' }]],
|
||||
use: {
|
||||
baseURL: 'http://127.0.0.1:8123',
|
||||
viewport: { width: 1440, height: 900 },
|
||||
},
|
||||
webServer: {
|
||||
command: 'python3 -m http.server 8123 --bind 127.0.0.1 --directory dist',
|
||||
url: 'http://127.0.0.1:8123/index.html',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 15000,
|
||||
},
|
||||
projects: [
|
||||
{ name: 'chromium', use: { browserName: 'chromium' } },
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user