feat: add Playwright integration tests with coverage and log capture

- Added `@playwright/test` and `c8` dependencies.
- Configured Playwright in `playwright.config.js` to run the dashboard server.
- Added `test/playwright/dashboard.spec.js` to verify dashboard functionality (loading, auth, config) and capture console logs.
- Modified `src/dashboard.mjs` to support graceful shutdown via `/shutdown` endpoint (guarded by `NODE_V8_COVERAGE`) for coverage collection.
- Updated `package.json` with `test:playwright` and `test:playwright:coverage` scripts.
- Updated `.gitignore` to exclude coverage and test artifacts.
- Fixed `host` default value in `src/cli-parser.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-22 03:22:12 +00:00
1 parent 3298830449
commit e8eec45ff7
8 files changed
+1187 -1

No files matched your search

+5
View File
@@ -67,6 +67,9 @@
"validate:scheduler-failure-schema": "node --test test/scheduler-lock-failure-schema.contract.test.mjs",
"test:ci-resilience": "node --test test/lock-acquisition-resilience.integration.test.mjs",
"test:extended-main": "npm run test:integration:e2e && npm run test:ci-resilience",
"test:playwright": "playwright test",
"test:playwright:coverage": "rm -rf coverage/playwright/tmp && mkdir -p coverage/playwright/tmp && CI=true playwright test && npx c8 report --temp-directory coverage/playwright/tmp --report-dir coverage/playwright --reporter text --reporter json --all --src src",
"test:playwright:ui": "playwright test --ui",
"torch:memory:list": "node bin/torch-lock.mjs list-memories",
"torch:memory:inspect": "node bin/torch-lock.mjs inspect-memory",
"torch:remove": "node bin/torch-lock.mjs remove"
@@ -77,6 +80,8 @@
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@playwright/test": "^1.58.2",
"c8": "^10.1.3",
"eslint": "^10.0.1",
"globals": "^17.3.0"
}