Playwright · Middle · Question 61 of 75

How can a test know it's running as a retry?

Show the answer

Correct answer: Check testInfo.retry, which is above 0 on retries

Explanation

It can be used to clear caches or collect extra logs on retry.

Further reading

Problem with a question

Playwright · Middle · question 61

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