Skip to main content

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.

Quiz

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
B. JUnit only knows passed, failed, skipped and error. To see flaky tests, use the HTML report or the flaky status in the JSON report.
Quiz

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 with test.fail() that failed
  • C. It was skipped
  • D. It is still running
Show answer
B. The test status compares the outcome with what was expected. Each attempt has its own result status: passed, failed, timedOut, skipped or interrupted.
Quiz

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
B. No browser download on every run, and identical font rendering to npm run test:visual. The image tag must match @playwright/test in package.json exactly.
Quiz

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
C. Two HTML reports would each show half the run. npx playwright merge-reports combines the blob reports and runs the HTML, JSON and JUnit reporters once, for all tests.
Quiz

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
B. The default fail-fast: true cancels the rest of the matrix on the first failure. You get a red run with half a report.
Quiz

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
B. The report job runs whenever the run was not cancelled, and merges whatever blob reports exist. A green summary with too few tests is a warning, not good news.
Quiz

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
B. 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.
Quiz

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
Show answer
C. A false product bug sends a developer on a hunt and costs trust in the suite. The assistant proposes; a person who has looked at the evidence decides.