lecture 15 of 180 completed

The test that only fails on the build server

Traces make Playwright unusually good at this. Here is the method, step by step.

What you'll learn

  • How to investigate a failure you cannot reproduce
  • How to read a trace rather than guess
  • What evidence to collect before you need it

This will happen to you, probably in your first month. A test fails on the build server about once in ten runs. On your machine it passes every time. Someone re-runs the build, it goes green, and everyone moves on.

Do not move on. Playwright gives you a very strong tool for this, and most juniors do not know it exists.

Step 1. Turn on traces. A trace is a recording of everything the test did: every action, every network call, and a snapshot of the page at each step.

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →