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] Default test scripts included in the Playwright package are not running correctly in Gitbash #27996
Comments
@auto-franklin Most likely, you have two different versions of Playwright. The one which provides the CLI executed by As a workaround, try the following: node node_modules\@playwright\test\cli.js test Let me know whether this helps. |
Hey, thanks for the reply! I used your command and I got this.
Another thing I should probably mention is that, when installing the node I realized I was choosing the nvm linux or osx option instead of the nvm-windows option, so I ended up downloading an installer for windows instead of installing it through gitbash (although I am aware that this is discouraged by the node creators due to possible conflicts with local-global permits) I downloaded an installer for windows and used the Node.js command prompt to execute the command npx playwright test then executed npx playwright show-report When trying to execute the same commands in Gitbash I get the same mistakes as before. |
Well, judging by
Yay!
Unfortunately, I am not really sure we can help with this. It is a question about using node/npm inside GitBash, and Playwright team are not the experts on the matter. Given this, let me close this issue as non-actionable from Playwright side. However, if you figure out the solution, consider commenting here for all other GitBash users to benefit from. |
I found this but its closed and I cannot seem to find a clear answer for it.
#17500
According to the official site Version 1.39.0 is the latest one
System info
Source code
Config file
Test file (self-contained)
Steps
- Bug occurs
Expected
After a freshly installed version of npm, node and playwright, when executing npx playwright test in my git bash console I should be able to correctly execute the default 6 test scripts that come along the playwrights tool package.
Actual
When executing npx playwright test in my git bash console I get this error message and the tests are not executed at all.
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:3
1 | import { test, expect } from '@playwright/test';
2 |
3 | test('has title', async ({ page }) => {
| ^
4 | await page.goto('https://playwright.dev/');
5 |
6 | // Expect a title "to contain" a substring.
at TestTypeImpl._currentSuite (C:\Users\Frank\documents\proyectos\frankplaywright\node_modules\playwright\lib\common\testType.js:71:13)
at TestTypeImpl._createTest (C:\Users\Frank\documents\proyectos\frankplaywright\node_modules\playwright\lib\common\testType.js:77:24)
at C:\Users\Frank\documents\proyectos\frankplaywright\node_modules\playwright\lib\transform\transform.js:236:12
at Object. (C:\Users\Frank\documents\proyectos\frankplaywright\tests\example.spec.ts:3:5)
Error: No tests found
To open last HTML report run:
npx playwright show-report
The text was updated successfully, but these errors were encountered: