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

Question:Playwright Test did not expect test() to be called here. #257

Open
tutanjamon2020 opened this issue Dec 18, 2024 · 1 comment
Open
Labels
question Further information is requested

Comments

@tutanjamon2020
Copy link

Since I updated my Playwright project to use AWS secret credentials I cannot run the test cases correctly.

I have this error message:

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 example.spec.ts:26

24 |
25 | // Test for login functionality, navigation, and work orders check

26 | test('Vytal WO View', async ({ page }) => {
| ^
27 | test.setTimeout(180_000);
28 | await login(page);
29 | await page.click('div.MuiListItemIcon-root.css-1f8bwsm');
at TestTypeImpl._currentSuite (C:\WINDOWS\system32\node_modules\playwright\lib\common\testType.js:72:13)
at TestTypeImpl._createTest (C:\WINDOWS\system32\node_modules\playwright\lib\common\testType.js:78:24)
at C:\WINDOWS\system32\node_modules\playwright\lib\transform\transform.js:288:12
at Object. (C:\WINDOWS\system32\tests\example.spec.ts:26:5)

I've checked the package.json, playwright.config, helper, etc. files and I can't find any conflicts. Any ideas?

@tutanjamon2020 tutanjamon2020 added the question Further information is requested label Dec 18, 2024
@vitalets
Copy link
Owner

What is the location of you project on your machine?
By the paths in the error, it looks like some global installation of Playwright is used:

C:\WINDOWS\system32\node_modules\playwright\lib\transform\transform.js

I'd expect it something like:

C:\WINDOWS\Users\<user>\Projects\<project-name>\node_modules\playwright\...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants