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] possible bug when test cannot be run from vscode #17509

Closed
LadaVarga opened this issue Sep 21, 2022 · 3 comments
Closed

[BUG] possible bug when test cannot be run from vscode #17509

LadaVarga opened this issue Sep 21, 2022 · 3 comments

Comments

@LadaVarga
Copy link

LadaVarga commented Sep 21, 2022

Context:

  • Playwright Version: 1.26
  • Operating System: Windows 11
  • Node.js version: [e.g. 12.22, 14.6]
  • Visual Studio Code version:
    Version: 1.71.2 (system setup)
    Commit: 74b1f979648cc44d385a2286793c226e611f59e7
    Date: 2022-09-14T21:03:37.738Z
    Electron: 19.0.12
    Chromium: 102.0.5005.167
    Node.js: 16.14.2
    V8: 10.2.154.15-electron.0
    OS: Windows_NT x64 10.0.22000
    Sandboxed: No
  • Playwright for VSCode extension version: [e.g. 1.2.3]
  • Browser: [e.g. All, Chromium, Firefox, WebKit]
  • Extra: [any specific details about your environment]

Describe the bug

I have problem with running tests from VScode plugin from test window (run and debug behave same). Till version 1.26 it was ok, I used version 1.21.1. I simple run npx playwirht install to install the latest + I tried reinstall VScode plugin too.
If I use npx playwright test it works properly.

DEBUG CONSOLE
C:\Program Files\nodejs\node.exe .\node_modules\playwright-core\lib\cli\cli test -c playwright.config.ts --headed --project=chromium --repeat-each 1 --retries 0 --timeout 0 --workers 1

Running 0 tests using 0 workers

Error: tests\bid-board-integrated.spec.ts:91:16: 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 ..\node_modules@playwright\test\lib\util.js:216

    214 |
    215 | function errorWithLocation(location, message) {

216 | return new Error(${formatLocation(location)}: ${message});
| ^
217 | }
218 |
219 | function expectTypes(receiver, types, matcherName) {

at errorWithLocation (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\util.js:216:10)
at TestTypeImpl._ensureCurrentSuite (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\testType.js:80:41)
at TestTypeImpl._createTest (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\testType.js:89:24)
at C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\transform.js:267:12
at Object.<anonymous> (C:\Git\esticom-frontend\E2E-Playwright\tests\bid-board-integrated.spec.ts:91:16)

Error: tests\bid-board.spec.ts:11:12: Playwright Test did not expect test.beforeEach() to be called here.
Most common reasons include:

  • You are calling test.beforeEach() in a configuration file.

  • You are calling test.beforeEach() 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 ..\node_modules@playwright\test\lib\util.js:216

    214 |
    215 | function errorWithLocation(location, message) {

216 | return new Error(${formatLocation(location)}: ${message});
| ^
217 | }
218 |
219 | function expectTypes(receiver, types, matcherName) {

at errorWithLocation (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\util.js:216:10)
at TestTypeImpl._ensureCurrentSuite (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\testType.js:80:41)
at TestTypeImpl._hook (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\testType.js:148:24)
at Function.beforeEach (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\transform.js:267:12)
at Object.<anonymous> (C:\Git\esticom-frontend\E2E-Playwright\tests\bid-board.spec.ts:11:12)

Error: tests\staging.spec.ts:9:12: Playwright Test did not expect test.beforeEach() to be called here.
Most common reasons include:

  • You are calling test.beforeEach() in a configuration file.

  • You are calling test.beforeEach() 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 ..\node_modules@playwright\test\lib\util.js:216

    214 |
    215 | function errorWithLocation(location, message) {

216 | return new Error(${formatLocation(location)}: ${message});
| ^
217 | }
218 |
219 | function expectTypes(receiver, types, matcherName) {

at errorWithLocation (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\util.js:216:10)
at TestTypeImpl._ensureCurrentSuite (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\testType.js:80:41)
at TestTypeImpl._hook (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\testType.js:148:24)
at Function.beforeEach (C:\Git\esticom-frontend\E2E-Playwright\node_modules\@playwright\test\lib\transform.js:267:12)
at Object.<anonymous> (C:\Git\esticom-frontend\E2E-Playwright\tests\staging.spec.ts:9:12)

=================
no tests found.

3 errors were not a part of any test, see above for details

@LadaVarga
Copy link
Author

If I downgrade to previous version 1.21.1 the VScode plugin works properly(I need install older chromium) and I can debug and run tests from VScode.

@rwoll

This comment was marked as outdated.

@rwoll
Copy link
Member

rwoll commented Sep 21, 2022

Folding into #17500.

@rwoll rwoll closed this as completed Sep 21, 2022
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

2 participants