-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Expose the step API to fixtures #27059
Comments
@dvoytenko Could you share a short snippet illustrating your usage of |
Here's an example from Playwright UI of what we're doing in our fixture: And here's an example of a failed mock: The only way we found how to do this is by using the
We'd definitely use An aside on the error status. Ideally, a step can be marked as failing without interrupting the complete test. Currently, if the |
@dvoytenko We can probably add more options to
You should be able to catch the step: await test.step('title', async () => {
throw new Error();
}).catch(() => {}); |
Thanks! I think this would be a great feature. |
@dgozman I also noticed that there's a "LOGS" section inside the "Call" tab. Not critical, but if that could also be exposed - that'd help some use cases. |
This feature eases debugging significantly. This is what an intercepted fetch looks like in Playwright debugger: <img width="342" alt="image" src="https://github.com/vercel/next.js/assets/726049/e9fe4304-36b9-4d6d-b4f3-66d649464a35"> <img width="368" alt="image" src="https://github.com/vercel/next.js/assets/726049/db49e18e-3fc5-4a77-abf8-465d925082bc"> And here's what a failing fetch looks like: <img width="314" alt="image" src="https://github.com/vercel/next.js/assets/726049/41be212a-e414-4b28-a0cb-d9b618b3f2ea"> You can inspect request and response's headers and bodies. The main drawback: it uses an internal Playwright API. However, they are open to opening part of it publicly in microsoft/playwright#27059.
This pr removes a console.log that is making testmode tests very noisy. This relates to an upstream feature request: microsoft/playwright#27059 Closes NEXT-3139
Our fixture performs some advanced mocking and it would be very convenient if it could output information, similar to how "route" information is output as steps. The information that could be displayed for a mocking operation would be:
We're using the
test.step()
API right now, but it doesn't allow setting most of these parameters. We've also tried to use the private_runAsStep()
, which allows setting all the data, but not a public API.The text was updated successfully, but these errors were encountered: