-
-
Notifications
You must be signed in to change notification settings - Fork 38
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: failed test output points to wrong line in code #227
Comments
Sure, I'll look into it further at my end. |
When I open a different repo that does not use bddgen, just Playwright on its own, the error report points to the right place. So I don't think it's environmental/system, it's at the repo level. I'll carry on trying to isolate it. |
I get the same result in both VSCode and IntelliJ IDEA. |
Reinstalling node modules made no difference. |
Setting up a new repo via |
Adding bdd-playwright to the same repo and generating a test spec file with it and adding the error points to the wrong place. Error occurs with both typescript and javascript. |
I'm really at a loss now. Apart from sharing my actual system via a teams call or something, I'm not sure how to resolve this issue locally or reproduce this issue elsewhere. |
Disabled WSL and Hyper-V, no change. |
@UncleGus I've simplified playwright-bdd-example - kept only one step, removed cucumber reporter and added non-bdd project. Could you try to clone and run When I run
...
Thank you for your investigation! |
I'll have to get to that tomorrow, but I will say that I've added non-bdd tests to the actual project that I'm working in, and it reports errors at the correct line. |
Okay, that didn't take as long as I though :P Here's my output, and it's looking promising:
|
Running the non-bdd project on its own got the same results for that test. |
A colleague cloned the repo and had the exact same issue, so whatever the cause is, it's not specific to my laptop. |
I will think how to debug that deeper. |
Given
Config:
Feature file:
Folders:
When
I added a line to throw an error in the steps definition file, and ran the test from the playwright test runner in VSCode, after running bddgen.
Then
The error was thrown and ended the test but the test-results reports the error in the wrong position:
But I expect
This is actually reasonably close, but in most non-artificially caused errors, it's out by 30-40 lines. Probably proportional to the line number. I expect it to point to where it actually failed. This offset also comes through in the playwright HTML report.
Isolated demo
https://github.com/vitalets/playwright-bdd-example/pull/21In this case, the results point to a line past where it should, to a line that doesn't even exist:
Environment
The text was updated successfully, but these errors were encountered: