Description
🚀 Feature Request
Currently, Playwright does not provide a method such as test.pass() to immediately mark a test as passed and exit early. While using return achieves a similar effect, it can be ambiguous when reviewing test logs or understanding developer intent. Having a clear, expressive way to exit a test with a "passed" status—especially under conditional scenarios—would improve readability and convey semantics more directly.
Example
-
Sometimes I need to run a test suite but some of the tests should be skipped either for time saving or they are not relevant.
-
Dynamically skipping parts of a test when preconditions are met, but still considering it a successful validation.
-
Improving clarity in CI logs by distinguishing between skipped, failed, and explicitly passed conditions.
-
Allowing finer control in custom test helpers and shared test setups.
Motivation
I believe that are a number of use cases for this functionality and I specifically find that test.skip() is often inconvenient if I want part of a test to run. This would allow us to pass a test at any point where we determine it is appropriate.