No tests found: Run Playwright with --list

updated November 10, 2026

Playwright stops before a browser opens. From the folder with your Playwright config, remove any file or title filters and run:

npx playwright test --list

If your test appears, run it using the file path in the list. If the list is empty, check the file name and the folder first.

Error: No tests found

Our file contained a test, but its name was tests/cart.ts. Playwright printed:

Error: No tests found

We renamed the file to tests/cart.spec.ts. The next --list run printed:

Listing tests:
  tests/cart.spec.ts:2:1 › adds a book
Total: 1 test in 1 file

By default, names like cart.spec.ts and cart.test.js match. Check testDir in the config for the folder Playwright searches. Check testMatch for the file names it accepts. A --grep filter that matched no test also gave us the short error.

Make sure that arguments are regular expressions matching test files.

We passed a file name on the command line that matched no test file. This time Playwright printed a longer message:

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.

A bare argument matches a file path. To select by test name, use --grep. For the test above, either command works:

npx playwright test tests/cart.spec.ts
npx playwright test --grep "adds a book"

Python: no tests ran

If you use pytest with Playwright, run python -m pytest --collect-only. Our example.py contained a function named test_adds_a_book. Pytest reported no tests ran. Renaming the file to test_example.py made the test run and pass.

We checked Playwright Test 1.65.0 on macOS 15.4.1 and Debian 12 on 10 November 2026. JavaScript and TypeScript gave the same errors with CI=1 and with CI unset. The Python run used pytest 9.2.0 and pytest-playwright 0.10.0.

Put it into practice

Solve a graded problem: write a test, and we check it would catch a real bug.

Browse the problems →

Learn this in full

Reading about a problem is not the same as fixing one. Pick a lecture or a practice problem and write the test yourself.

Keep reading