-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Error: No tests found #30768
Comments
You need to adjust testDir in such kind of scenarios: import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: '../tests',
}); |
I am using testMatch: ['/specs/smoke/tests/*.spec.ts'], which works fine when the playwright.config.ts is at the root level. |
Yes, this is because testDir is by default the directory where the playwright.config file is located. In your case you would have to change it to e.g. import path from 'path'
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: path.join(__dirname, '..'),
}); |
My issue has been resolved with the provided solution. Thank you. This can be closed |
Version
1.44.0
Steps to reproduce
"I attempted to run Playwright tests using the npx playwright test command, and my tests executed successfully. However, after moving the playwright.config.ts file to a folder structured as conf/playwright.config.ts, I consistently received a 'no test found' error."
Below is the code that is causing the problem.
"scripts": {
"smoke": "npx playwright test -c conf/playwright.config.ts",
Expected behavior
I expect the tests to run, like how they if the config file is in the root of the project
Actual behavior
Error : No tests found
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: