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

Playwright test cant execute the example test given in the install playwright[BUG] #17572

Closed
levayzsombor opened this issue Sep 25, 2022 · 2 comments

Comments

@levayzsombor
Copy link

levayzsombor commented Sep 25, 2022

Context:

  • Playwright Version: 1.26.0
  • Operating System: Windows 10
  • Node.js version: '16.17.1
  • Visual Studio Code version: 1.71.2
  • Playwright for VSCode extension version: 1.26.0
  • Browser: All
  • Extra: I can run npx playwright test in the directory just fine only the Playwright test throws this error
    Code Snippet

Running 0 tests using 0 workers
Error: tests\example.spec.ts:5: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:\work\playwright\node_modules\@playwright\test\lib\util.js:216:10)
at TestTypeImpl._ensureCurrentSuite (C:\work\playwright\node_modules\@playwright\test\lib\testType.js:80:41)
at TestTypeImpl._createTest (C:\work\playwright\node_modules\@playwright\test\lib\testType.js:89:24)
at C:\work\playwright\node_modules\@playwright\test\lib\transform.js:267:12
at Object.<anonymous> (C:\work\playwright\tests\example.spec.ts:5:16)

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

1 error was not a part of any test, see above for details

Test run finished at 9/25/2022, 3:42:12 PM <

Describe the bug

I just installed a fresh Node.js and a Fresh VS Code to test out playwright as a test framework. I installed the Microsoft Playwright extension in VS Code and created a project with test: Install Playwright. when i executed the "npx playwright test" in the directory it worked, but when I tried to use the test explorer it throws this error. I'm not sure what it wants to find in at Object. (C:\work\playwright\tests\example.spec.ts:5:16) since that's an empty line:
image

I changed nothing in the entire directory it doesn't work simply when installed. Also the green triangles that indicates the test can be executed are also missing.

@LoreCrux
Copy link

I am in a similar boat. Whenever I try to run the example test, it says:

Running 0 tests using 0 workers

no tests found.

My current tests still work, but any NEW tests after updating to v1.26.0 are not being found. I have downgraded to v1.25.0 on all aspects of Playwright the new tests are still not found. I even went as far as uninstalling Playwright and reinstalling. Something fundamentally changed with Playwright it seems with v1.26.0.

@aslushnikov
Copy link
Collaborator

This is dupe of #17500 and will be fixed in 1.26.1 (scheduled for tomorrow)

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