You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playwright test runs successfully locally but encounters errors when executed on a different environment (such as after pushing to a git repo and running on a CI/CD pipeline or another machine)
#30783
Closed
Amuthan07 opened this issue
May 14, 2024
· 1 comment
I created playwright test files on my local machine, the test scripts were working for me
However when I pushed the same to a repo when I created a branch and tried to run it, it's not working
throwing 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 Playwright/tests/Amazon/login.spec.js:6
4 |
5 |
6 | test('If sign-in button is there', async ({page}) => {
| ^
7 | //check if the sign-in button is present
8 | await page.goto(urlToTest);
9 | await page.getByRole('link', { name: 'Sign in', exact: true }).click();
at TestTypeImpl._currentSuite (/Users/amu/Downloads/amazon-playwright-automation/Playwright/node_modules/playwright/lib/common/testType.js:71:13)
at TestTypeImpl._createTest (/Users/amu/Downloads/amazon-playwright-automation/Playwright/node_modules/playwright/lib/common/testType.js:80:24)
at /Users/amu/Downloads/amazon-playwright-automation/Playwright/node_modules/playwright/lib/transform/transform.js:256:12
at Object.<anonymous> (/Users/amu/Downloads/amazon-playwright-automation/Playwright/tests/Amazon/login.spec.js:6:5)
Error: No tests found.
Make sure that arguments are regular expressions matching test files.
You may need to escape symbols like "$" or "*" and quote the arguments.
The text was updated successfully, but these errors were encountered:
Amuthan07
changed the title
I created playwright test files on my local machine, the test scripts were working for me
Playwright test runs successfully locally but encounters errors when executed on a different environment (such as after pushing to a git repo and running on a CI/CD pipeline or another machine)
May 14, 2024
This issue is not following the bug template. Please re-file and provide a self-contained reproduction, which we can run locally to reproduce your issue. Thanks for your understanding!
However when I pushed the same to a repo when I created a branch and tried to run it, it's not working
throwing 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 Playwright/tests/Amazon/login.spec.js:6
4 |
5 |
Error: No tests found.
Make sure that arguments are regular expressions matching test files.
You may need to escape symbols like "$" or "*" and quote the arguments.
Originally posted by @Amuthan07 in #17500 (comment)
The text was updated successfully, but these errors were encountered: