PW CI Configurator
A workflow already exists
.github/workflows/playwright.yml runs on push and PR to main/master. Edit it; do not
generate a second one. Four things about this repo constrain any change:
- Tests run headed.
headless: falseinplaywright.config.ts, so the run is wrapped inxvfb-run --auto-servernum. Any new job needs the same wrapper or it dies with no display. .envis gitignored, so the runner has none. TheSeed .env for the test runstep (cp .env.example .env) must survive. Without it,src/config/env.tsthrows at collection and the whole suite fails, not just the specs that need it.- Retries are CI-only, driven by
process.env.CI. Do not hard-code retries in the workflow. - The report is custom.
src/utils/CustomReporter.tswritestta-report/andreports/runs/. The workflow currently uploads onlyplaywright-report/, so the TTA report is being lost.
Highest-value changes, in order
- name: Seed .env for the test run
run: cp .env.example .env
- name: Run Playwright tests
run: xvfb-run --auto-servernum npx playwright test --shard=${{ matrix.shard }}/4
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: tta-report-${{ matrix.shard }}
path: |
tta-report/
reports/runs/
retention-days: 30
Sharding needs strategy: { fail-fast: false, matrix: { shard: [1, 2, 3, 4] } }. With five tests
today, sharding is premature; add it when the suite justifies it and say so rather than shipping
four jobs for five tests.
Secrets
When real credentials replace the demo values, drop cp .env.example .env for an env: block
backed by repository secrets. STANDARD_USER and TTA_SECRET are the keys @config/credentials
reads.
Verify
mv .env .env.bak && npx playwright test # must fail the way CI would
cp .env.example .env && npx playwright test
mv .env.bak .env
This reproduces the runner's state locally, which is the only way to test a CI change without pushing.