-
-
Notifications
You must be signed in to change notification settings - Fork 42
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: Error: Requiring @playwright/test second time #94
Comments
Thanks for sharing this, I will check. |
Hi @vitalets Did you have a chance to check ? |
Hi @phramusca |
I've come across this issue where I have two choices:
|
Is it TypeScript error or Node.js runtime error? Could you share the full message?
After installing Cucumber you are getting |
Confirming also receiving this issue. Running via a command line and no issue exists, whilst trying to run individual tests in the IDE to debug, the error appears. package.json
Error:
|
@AdamJS123 @adamwood-novafori thanks, trying to reproduce. |
@AdamJS123 @adamwood-novafori could you clone playwright-bdd-example and try to reproduce this issue on it? |
The last screenshot in my previous message is from the example project:
Hope this helps |
Same issue with the steps above. Unable to execute the test from the test runner. |
@JHGould5607 could you also share error stack with paths of requiring Playwright? |
I made some experiments: |
How I install the example PS C:\rep\playwright-bdd-example> npm install added 293 packages, and audited 294 packages in 10s 81 packages are looking for funding found 0 vulnerabilities
Running 1 test using 1 worker npm ERR! A complete log of this run can be found in: C:\Users\grzpav04\AppData\Local\npm-cache_logs\2024-04-08T10_48_25_198Z-debug-0.log |
When I run test in MS VSC using Test Explorer I got following output: Running 1 test using 1 worker
Error in reporter Error: __bddData annotation is not found for test "Check title". |
I've made some investigation and released v6.3.0 that should possibly fix the issue.
const testDir = defineBddConfig({
paths: ['playwright/features/**/*.feature'],
- require: ['playwright/steps/**'],
+ steps: ['playwright/steps/**'],
});
|
After #136 this issue should gone, b/c there will be single place of requiring Playwright. |
This error should gone as since v7 playwright-bdd does not use Cucumber for requiring steps. |
Given
playwright.config.ts:
When
I try to run/debug tests in Visual Code with the "Playwright Test for VSCode" extension
Then
If I run in debug mode, it stops with this first error (then there are others if I continue):
and in the end, I get this error in the test results console:
But I expect
test to run/debug.
Note that the tests are running fine with
npx bddgen && npx playwright test
.Isolated demo
Hard to make a demo since tests are included in a web react project that I cannot share easily. But I will try if really needed at one point.
Environment
The text was updated successfully, but these errors were encountered: