Skip to content
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

[Bug]: Playwright Should Never Fail Silently: It Should Always Report Why a Test Stopped #29426

Closed
jwalkerinterpres opened this issue Feb 8, 2024 · 4 comments

Comments

@jwalkerinterpres
Copy link

jwalkerinterpres commented Feb 8, 2024

Version

1.40.1

Steps to reproduce

This is a general issue (not specific to any test/code).

Expected behavior

When playwright exits, the user should always see some sort of explanation why. They should never see a screen like this one:
image

NOTE: Every other tab is similarly empty, except for the Source tab, which just shows the test itself:
image

Actual behavior

You see a screen like the above.

Look, Playwright knows why it stopped running 100% of the time, right? There's no reason why it shouldn't report that reason 100% of the time also. Ideally every test failure should have some explanatory text in the Errors tab, but if not there then at least in some other tab.

Of course, in these situations Playwright doesn't have an obvious error, so it can't show a lot of info ... but it should still be able to say "the test ran too long and exceeded the timeout", or "a promise didn't finish in a beforeEach" or something that conveys why it stopped running.

Additional context

Obviously, the specific reason this is happening has to do with my test code, but the issue I'm trying to raise is not specific to my code. It shouldn't matter what the test code is: the test runner always knows why its exiting, so I'm simply requesting that it always surface that information.

Environment

System:
    OS: macOS 14.3
    Memory: 53.08 MB / 32.00 GB
  Binaries:
    Node: 21.2.0 - /usr/local/bin/node
    Yarn: 1.22.21 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
  Languages:
    Bash: 3.2.57 - /bin/bash
@rkhomi
Copy link

rkhomi commented Feb 9, 2024

Yeah, UI runner does not show typeError from TS, you will be able to see error if you only run in terminal, that's strange

@dgozman
Copy link
Contributor

dgozman commented Feb 9, 2024

This seems similar to #29133, which has been recently fixed. Could you please try with the @next release and see whether you can actually see an error in the Errors tab?

npm install @playwright/test@next

@jwalkerinterpres
Copy link
Author

Unfortunately the issue was a bit of Heisenbug originally (ie. it only occurred some of the time, unreliably), and it's not happening now.

However, I am running @playwright/test@next, and I'll report back if I see the issue again. If I don't, I think the ticket can be safely closed.

@mxschmitt
Copy link
Member

Great, don't hesitate to re-file, since we usually don't monitor closed issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants