-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 inspector highlights the wrong line of code when running from mocha #21211
Comments
Looks like your mocha setup is not generating source maps when it compiles TS. As a side note, using @playwright/test will make you several times more productive as it'll manage parallelism, browser contexts, trace files the best way possible. Making it work with mocha will take weeks and will still be wrong. |
I agree that it looks like it is not generating source maps but it is more complex. I have now pushed a new commit with simple setup for mocha-typescript test based on mocha example. The new simple test reports the assertion fail line correctly (line 25) as long as the code for Playwright test is commented out. When playwright code is included in the run, the failing line number is 22. Thanks for the advice but I have a pretty stable setup since the 1.7 version of Playwright. It is far from "wrong". I just hope that Playwright will support its usage as the "APIs for launching and interacting with browsers". |
I'm not sure what I should be doing with that repo. I run it and it passes, I uncomment the commented line and everything stalls.
You'll be surprised!
Playwright Library will keep working. But the playwright assertions that you take from |
We need more information to act on this report. As long as we can't repro it, it is unlikely with can make progress with it. Allow me to close it, but please file a new one and link to this issue when you get back to it! |
Sorry, I did not notice that after I stripped the tsconfig.json to minimum the inspector actually stopped showing anything when the execution reached There are 2 tests there - both do not pass. Do the following:
this is actually very important information |
Please reopen. The sourcemaps are setup correctly. The test which is not using playwright proves it. In that test the lines for assertion exceptions are reported correctly as long as playwright's lib is uncommented. |
Context:
System:
Binaries:
Languages:
npmPackages:
Code Snippet
https://github.com/PawelWesolowski/playwright-repro-repo-for-wrong-line
Describe the bug
When running playwright lib from a mocha test written in typescript, the inspector will highlight wrong line of the test file. When the test fails, wrong line is being reported.
This is almost the same as #19944 but reproduced by a mocha-runner, not a cucumber-runner.
The text was updated successfully, but these errors were encountered: