Find tests
find_testsList a Playwright or Vitest project's tests matching filters, read from source without running them, to find skipped tests and why, tags, or leftover .only.
Instructions
Lists a project's tests that match filters, read from the test files without running them: each with its id, full name, file and line, state, skip reason and condition, and tags by default. Use it for questions such as which tests are skipped and why, which tests carry @smoke, or where a .only was left in; use test_summary for counts and get_tests for every key of a few ids. Filters combine with AND; a list matches any of its values. fields picks other keys of the test records (id is always there). Answers are paged: follow nextCursor, or narrow the filters. Example: {"states": ["skip"], "withoutReason": true}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grep | No | Keeps tests whose fullName (describe titles and title joined with " > ") matches this regular expression, ignoring case. | |
| only | No | true keeps tests that use .only, or are in a describe that does. | |
| tags | No | Keeps tests with one of these tags, written as in the titles, such as "@smoke". | |
| limit | No | The most items to return. | |
| cursor | No | nextCursor from the previous answer, for the next page. Keep the other arguments the same. | |
| fields | No | Keys of each test record to return, besides id. Default: fullName, relativeFilePath, lineStart, state, reason, condition, tags. | |
| states | No | Keeps tests in one of these states. | |
| patterns | No | Globs of the test files, relative to `directory`, such as ["tests/**/*.spec.ts"]. Default: the ones the server was started with. | |
| directory | No | A folder inside the project to scan, relative to its root, such as "packages/web". Default: the root. | |
| framework | No | The test runner. Default: the one the server was started with. | |
| withoutReason | No | true keeps tests that don't run and give no reason. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | Yes | ||
| tests | Yes | One page of matching tests, in file and line order. | |
| total | Yes | All matching items, on every page. | |
| framework | Yes | ||
| nextCursor | Yes | ||
| scanErrors | Yes | Problems of level error in the scan, which may leave tests out of the answer. | |
| frameworkVersion | Yes |