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

[Regression]: playwright vscode extension won't debug sample project error: Test did not expect test() to be called here. #30889

Closed
stevenebutler opened this issue May 18, 2024 · 4 comments

Comments

@stevenebutler
Copy link

Last Good Version

Extension version 1.1.2

First Bad Version

Extension version 1.1.3

Steps to reproduce

  1. Create a new folder and launch in code with playwright extension installed.
  2. Use CTRL-P: Test: Install Playwright and select a vanilla project with chromium
  3. Load the test lab tab and expand the testing.
  4. Attempt to run 'has title' test with the debug option

Expected behavior

I expect the test to run in the VsCode debugger allowing me to set breakpoints etc. This worked with previous version of playwright extension

Actual behavior

I see the following error.

Error: Playwright Test did not expect test() to be called here.
Most common reasons include:
- You are calling test() in a configuration file.
- You are calling test() in a file that is imported by the configuration file.
- You have two different versions of @playwright/test. This usually happens
  when one of the dependencies in your package.json depends on @playwright/test.
    at TestTypeImpl._currentSuite (c:\dev\git\temp\temp2\node_modules\playwright\lib\common\testType.js:71:13)
    at TestTypeImpl._createTest (c:\dev\git\temp\temp2\node_modules\playwright\lib\common\testType.js:80:24)
    at node_modules\playwright\lib\transform\transform.js:256:12
    at Object.<anonymous> (c:\dev\git\temp\temp2\tests\example.spec.ts:3:5)

Additional context

Note this was first seen in my normal project so I tried with vanilla project to see if it was something about my project, but see the same error on the sample project tests.

VScode Extension version is 1.1.3

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 3.87 GB / 15.65 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.0.2 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.1.0 - C:\Program Files\nodejs\pnpm.CMD
    bun: 1.1.3 - ~\.bun\bin\bun.EXE
  IDEs:
    VSCode: 1.89.1 - C:\Users\sebut\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.21
  npmPackages:
    @playwright/test: ^1.44.0 => 1.44.0
@mxschmitt
Copy link
Member

Please retry in v1.1.4 which we just released.

@AlexandreBartie
Copy link

Hi @mxschmitt ...

Playwright vscode extension v1.1.4 is running fine in debug mode again in my project. Thank you for fix this!

@mxschmitt
Copy link
Member

I'll close this one, since this issue is resolved.

@stevenebutler
Copy link
Author

Can confirm working for me now too. Thanks.

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

3 participants