Playwright · Middle · Question 61 of 75
How can a test know it's running as a retry?
- 1Retries can't be detected from inside a test
- 2Read the
PLAYWRIGHT_RETRYenvironment variable - 3Check
testInfo.retry, which is above 0 on retries
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.