Playwright · Middle · Question 29 of 75

What happens the first time toHaveScreenshot() runs?

Show the answer

Correct answer: It fails and saves a baseline image

Explanation

There's nothing to compare against yet, so it writes the expected image. Later runs compare against it. --update-snapshots refreshes baselines on purpose.

Further reading

Problem with a question

Playwright · Middle · question 29

Test yourself

Take the Playwright · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz