Playwright · Middle · Question 31 of 75

How do you hide a changing element, like a clock, in a screenshot test?

Show the answer

Correct answer: Use the mask option with its locator

Explanation

Masked areas are covered with a box. animations: 'disabled' and maxDiffPixels also help reduce noise.

Further reading

Problem with a question

Playwright · Middle · question 31

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