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] VSCode Extension Test explorer not running any tests: "no tests found" "1 error was not a part of any test, see above for details" #17687

Closed
Wilhop opened this issue Sep 29, 2022 · 4 comments

Comments

@Wilhop
Copy link

Wilhop commented Sep 29, 2022

Context:

  • Playwright Version: 1.26.0
  • Operating System: Windows
  • Node.js version: v16.13.1
  • Visual Studio Code version: 1.71.2
  • Playwright for VSCode extension version: 0.2.10
  • Browser: [e.g. All, Chromium, Firefox, WebKit]

Reproducable repo:
https://github.com/Wilhop/PlaywrightExtensionRepro

1.I have the VSCode extension "Test explorer" open
2.I click on "Run test" button on any of the following tests: "plainLogin.spec.ts" or "Online.spec.ts"
3.It does not run any tests. Check console
no tests found.
1 error was not a part of any test, see above for details

image

Here is the log from the terminal:

Running 0 tests using 0 workers
Error: login\plainLogin.spec.ts:7:12: Playwright Test did not expect test.describe() to be called here.
Most common reasons include:
- You are calling test.describe() in a configuration file.
- You are calling test.describe() 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:\Users\villevi\PlaywrightMylly\Testi%20Projekti\node_modules\@playwright\test\lib\util.js:216:10)
    at TestTypeImpl._ensureCurrentSuite (C:\Users\villevi\PlaywrightMylly\Testi%20Projekti\node_modules\@playwright\test\lib\testType.js:80:41)
    at TestTypeImpl._describe (C:\Users\villevi\PlaywrightMylly\Testi%20Projekti\node_modules\@playwright\test\lib\testType.js:113:24)
    at Function.describe (C:\Users\villevi\PlaywrightMylly\Testi%20Projekti\node_modules\@playwright\test\lib\transform.js:267:12)
    at Object.<anonymous> (C:\Users\villevi\PlaywrightMylly\Testi%20Projekti\login\plainLogin.spec.ts:7:12)
=================
 no tests found.
=================
  1 error was not a part of any test, see above for details
> Test run finished at 9/29/2022, 7:01:13 AM <
@Wilhop Wilhop changed the title [BUG] [BUG] VSCode Extension Test explorer not running any tests: "no tests found" "1 error was not a part of any test, see above for details" Sep 29, 2022
@Mallikarjunkrs
Copy link

We were facing the same issue in Windows Playwright 1.26.0, after updating the Playwright version to 1.26.1. We have not observed this issue.

@Wilhop
Copy link
Author

Wilhop commented Sep 30, 2022

Updating Playwright to version 1.26.1 solved the issue, I appreciate your help @Mallikarjunkrs !

I'll close this, as it seems upgrading to the latest version is the answer.

@Wilhop Wilhop closed this as completed Sep 30, 2022
@jonny64
Copy link

jonny64 commented Oct 27, 2022

@Mallikarjunkrs how do I debug no tests found?

I want to match slices/**/tests/**/*.js for slices/${folder}/tests/${all subfolders}, there about 10 submodules

  • ls slices/**/tests/*.js prints just first level, but match occurs
  • Tried to inspect pw /tests/ and found no test about glob pattern
  • DEBUG=* npx playwright test prints NO info about matched files

If no debugging is possible, could you please point out where the hell in pw source code match occurs? I want to debug my case

Impact: integrating pw into my enviroment blocked

@jonny64
Copy link

jonny64 commented Oct 27, 2022

opened #18369

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