Quiz: Reporting and CI
Why This Matters
A quick check that this module’s ideas hold up before you move on. Answer each question yourself before you open the answer.
1. Your CI server has a test tab that reads JUnit XML. A test passed on its second attempt. What does the JUnit report show?
- A. Flaky
- B. Passed, because JUnit has no concept of flaky
- C. Failed
- D. Nothing; retried tests are left out
Show answer
flaky status in the JSON report.2. In the JSON report, a test has "status": "expected". What does that mean?
- A. It passed on the first attempt
- B. Its outcome matched
expectedStatus, which can also be a test marked withtest.fail()that failed - C. It was skipped
- D. It is still running
Show answer
passed, failed, timedOut, skipped or interrupted.3. Why does the workflow run in mcr.microsoft.com/playwright:v1.65.1-noble instead of installing browsers in a step?
- A. GitHub requires it
- B. The browsers are already in the image, and it is the same environment the visual baselines were made in
- C. It makes the tests run with more workers
- D. Containers do not need
npm ci
Show answer
npm run test:visual. The image tag must match @playwright/test in package.json exactly.4. Why does every shard write a blob report instead of an HTML report?
- A. Blob reports are smaller
- B. HTML reports do not work in CI
- C. Blob reports from several shards can be merged into one report for the whole run
- D. Blob reports include screenshots and HTML reports do not
Show answer
npx playwright merge-reports combines the blob reports and runs the HTML, JSON and JUnit reporters once, for all tests.5. What goes wrong if you remove fail-fast: false from the matrix?
- A. Nothing
- B. When one shard fails, GitHub cancels the others, and the merged report misses their results
- C. Failed tests are no longer retried
- D. The report job runs twice
Show answer
fail-fast: true cancels the rest of the matrix on the first failure. You get a red run with half a report.6. Shard 1 fails at the typecheck step. The summary on the run page says 63 passed, 0 failed. What happened?
- A. All tests passed
- B. Shard 1 ran no tests, so the report contains only shard 2. Compare with the total of 127.
- C. Typecheck errors are ignored by Playwright
- D. The report job crashed
Show answer
7. With two shards, shard 1 takes 1m 9s and shard 2 takes 1m 46s. Why the difference?
- A. The second machine is slower
- B. Shards are split by number of tests, not by duration, and shard 2 got only Firefox and WebKit tests
- C. Shard 2 runs the typecheck
- D. Shard 2 merges the reports
Show answer
npx playwright test --list --shard=2/2 shows it: 31 Firefox and 32 WebKit tests, against API and unit tests that take milliseconds in shard 1.8. An AI assistant calls a failure a product bug. What do you do?
- A. File the bug
- B. Re-run the pipeline
- C. Treat it as a hypothesis: check the evidence in the trace before anyone files a bug
- D. Delete the test