Playwright · Junior · Question 44 of 75
What does test.fail() mean?
- 1The test's failures are hidden from the HTML report
- 2The test is expected to fail; passing is reported as an error
- 3The test is forced to fail at the very first step
Show the answer
Correct answer: The test is expected to fail; passing is reported as an error
Explanation
It marks known bugs: Playwright runs the test and complains if it unexpectedly passes, signalling the bug may be fixed.