35 lines
1.4 KiB
Markdown

# E2E Playwright tests - Studio Panel
This guide explains how to run the Playwright E2E tests locally and in CI. The tests simulate Broadcast -> Token Server -> Studio flows and produce logs and screenshots for debugging.
Local quick run
```bash
cd packages/studio-panel
# optional: install playwright locally
npm install --no-audit --no-fund --no-save playwright
npx playwright install --with-deps
# run the helper script (installs playwright if missing and runs the test)
chmod +x run_playwright_test.sh
./run_playwright_test.sh
# After run, check artifacts:
ls -lh /tmp/playwright_debug.log /tmp/playwright_run_output.log
ls -lh /tmp/sim_postmessage_simulator.png /tmp/sim_postmessage_studio.png
```
CI (GitHub Actions)
A workflow has been added at `.github/workflows/e2e-playwright.yml`. It can be triggered from the Actions tab or via `workflow_dispatch`.
Set these repository secrets to override target URLs (optional):
- `BROADCAST_URL` - e.g. `https://avanzacast-broadcastpanel.bfzqqk.easypanel.host/post_token_to_studio.html?auto=1`
- `STUDIO_ORIGIN` - e.g. `https://avanzacast-studio.bfzqqk.easypanel.host`
The workflow will upload logs and screenshots as artifacts for download.
Troubleshooting
- If Playwright fails to install browsers on runners, try `npx playwright install --with-deps` locally to debug.
- If tests time out, increase timeouts in `scripts/playwright_postmessage_test.mjs`.