Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Playwright’s “No Tests Found” message means the runner selected zero test files or collected zero tests from the files it selected. Check the configured testDir, filename rules (testMatch and testIgnore), the config file actually loaded, and any path filter on your command. Then use --list or run one explicit file to determine whether discovery or test collection is failing.
What the error actually means
Playwright can fail at two different stages:
- File discovery: no file matches the configured directory and filters.
- Test collection: a file is found, but it declares no tests that Playwright can collect.
Those stages require different fixes. A file can exist in your repository and still be invisible because it is outside testDir, has a non-matching name, is excluded by testIgnore, is filtered out by the command line, or is generated only after a build step.
1. Confirm the file is inside the configured test directory
Open the configuration used by the command (commonly playwright.config.ts or playwright.config.js) and inspect testDir. The directory is resolved in relation to the configuration file. If the config moved, a relative path can now point somewhere different.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsimport { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests'
});
With this configuration, a test at tests/login.spec.ts is eligible, while e2e/login.spec.ts is not unless you change testDir or move the file.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Check which configuration Playwright loads
The CLI uses a configuration in the current directory by default. Explicitly select the intended file when you have several projects, run the command from a different directory, or recently relocated the config:
npx playwright test --config=playwright.config.ts
Do not assume that moving a config file is itself a Playwright defect. Recheck the working directory, the selected config path, and every relative path in that config.
2. Check the filename and extension
Playwright’s documented default testMatch pattern recognizes filenames containing test or spec with .js, .ts, or .mjs extensions. Typical names are:
tests/cart.spec.tstests/cart.test.jstests/admin.spec.mjs
Names such as tests/cart.ts, tests/cart-test.txt, or a file using another extension will not match that default. A project can override the default, so inspect your actual setting before renaming files.
export default defineConfig({
testDir: './tests',
testMatch: /.*.(spec|test).[jt]s$/
});
If you use a glob instead of a regular expression, make sure it covers nested directories and the extension you really generate. Keep the pattern narrow enough that helper files are not treated as tests.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
3. Look for an exclusion that removes the test
testIgnore accepts glob patterns or regular expressions. An over-broad rule can exclude every test:
export default defineConfig({
testDir: './tests',
testIgnore: ['**/fixtures/**', '**/*.generated.ts']
});
Temporarily remove or narrow a suspicious rule, then run discovery again. Pay attention to patterns such as **/*.ts, a top-level directory name that also contains your tests, or a regular expression that matches more paths than intended. Change an exclusion only after confirming which files it catches; broad deletions can cause fixtures or generated support files to be collected unexpectedly.
4. Check command-line filters and shell quoting
Every non-option argument passed to npx playwright test is a regular expression matched against the full test-file path. It is not merely a literal filename. A filter that looks correct can therefore select nothing:
# Literal-looking path; quote it so the shell does not alter it
npx playwright test "tests/checkout.spec.ts"
# A directory or regex filter
npx playwright test "tests/checkout"
# Explicit configuration plus a path filter
npx playwright test --config=playwright.config.ts "tests/checkout.spec.ts"
Shell metacharacters, backslashes, parentheses, brackets, and spaces can change the expression before Playwright receives it. Quote the argument and start with the simplest known path. If you copied a Windows path into a Unix shell (or vice versa), replace separators and remove accidental escape characters.
5. Use discovery commands to isolate the stage that fails
List collected tests without running them
npx playwright test --list
--list performs discovery and collection, then reports what would run. If your file does not appear, investigate testDir, testMatch, testIgnore, config selection, and command filters. If the file appears but contains no tests, skip filename troubleshooting and inspect its declarations.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Run one known file
npx playwright test tests/example.spec.ts
Use the path relative to the directory from which you invoke the command, and quote it when it contains spaces or regular-expression characters. This test distinguishes a global discovery problem from a filter or directory problem.
Check the installed CLI’s help
npx playwright test --help
Playwright evolves, and option behavior can differ between installed versions. Treat the help output from your local installation as authoritative for available flags.
6. Verify generated tests exist at runtime
Some projects generate JavaScript test files from templates, TypeScript, or another build step. In that arrangement, Playwright can be correctly configured while the expected files are simply absent when the test command starts.
- Identify the exact directory and extension matched by
testDirandtestMatch. - Run the generation or compilation step.
- Inspect the output directory and confirm at least one matching file exists.
- Run
npx playwright test --listagain.
A historical maintainer issue described TypeScript sources that had not been compiled to the JavaScript files selected by configuration. That is a project-specific cause, not a general requirement to compile ordinary TypeScript Playwright tests; Playwright normally supports .ts test files directly.
7. When a file is found but zero tests are collected
If --list shows the file but reports no tests, inspect the code that declares tests. Confirm that:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
- You import
testfrom@playwright/test, not a similarly named helper. - At least one
test(...)ortest.describe(...)block executes at module load time. - Conditional code is not skipping every declaration for the current environment.
- Data used to create parameterized tests is available before declarations run.
A 2021 issue discussed an asynchronous test.describe callback and data-driven declarations as a possible cause. It is historical and does not establish behavior for every current Playwright release. Reproduce the smallest example with your installed version and consult version-specific guidance rather than applying that report as a universal diagnosis.
A practical diagnosis matrix
| What you observe | Most likely area | Next action |
|---|---|---|
No files in --list |
Directory, filename match, ignore rule, config, or CLI regex | Print or inspect the loaded config; verify one file path against every rule. |
File exists but is outside testDir |
Directory configuration | Move the file or change testDir to the intended root. |
File appears in --list with zero tests |
Collection-time declarations | Check imports, conditional logic, asynchronous declaration code, and generated data. |
| Works only after a build | Missing generated output | Make generation a prerequisite of the test command and verify the output path. |
| Works with an explicit file but not the normal command | Global filter or config selection | Compare the normal command with the explicit command, including --config and positional arguments. |
Common mistakes and their fixes
The config is in a parent directory
Running from a subdirectory can make Playwright choose another config or none at all. Invoke the command from the project root or pass an explicit --config path.
The test was renamed to a neutral filename
profile.ts does not match the default naming convention. Rename it to profile.spec.ts or update testMatch.
An ignore rule matches the entire test tree
Reduce the glob to the generated or fixture directory that should really be excluded. Re-run --list after each change.
A positional argument was treated as a regex
Quote the path and remove unnecessary regex punctuation. Remember that matching is against the full test-file path, not only the basename.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
The build output is stale or missing
Delete stale output when appropriate, run the generator, and confirm that the newly created files use the extension and directory in your Playwright config.
The file loads but declarations never execute
Move test declarations out of asynchronous callbacks or runtime branches while debugging. Add a minimal unconditional test to determine whether collection itself works.
Reliability and maintenance practices
- Keep test files under one clearly documented
testDirwhere practical. - Use a consistent
*.spec.tsor*.test.tsconvention. - Keep
testIgnorerules specific and review them when directories change. - Make generated-test creation an explicit dependency in CI.
- Include a lightweight discovery check such as
npx playwright test --listin troubleshooting documentation. - Pin or record the Playwright version so that CLI and configuration behavior can be compared accurately.
Or skip the browser setup
If your immediate goal is a clean image or PDF of a web page rather than running browser tests, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
Free tools Windows power users keep installed
One-click scans. No signup required.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo documentation for the full set of capture options, including full-page and element shots, device and retina settings, custom CSS and JavaScript, waits, request blocking, cookies, headers, geolocation, PDFs, caching, signed links, webhooks, bulk capture, and the usage API. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
Frequently Asked Questions
Should I compile TypeScript before running Playwright?
Not for ordinary Playwright TypeScript tests; Playwright supports .ts files directly. Compile first only when your project deliberately generates or matches JavaScript output.
Why does an explicit test path work while the normal command finds nothing?
The normal command may load a different config or apply a positional regular-expression filter that excludes the file. Compare its working directory, –config value, and arguments with the successful command.
What does –list prove?
It shows the files and tests Playwright can discover and collect without executing them, allowing you to separate selection problems from runtime failures.
Recommended Free Tools
Can testIgnore use regular expressions?
Yes. Playwright documents glob patterns and regular expressions for filtering and ignoring files; verify the expression against the complete path.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

