Configuration
Learn about options to configure tests
Example
Config
Options
The name of the app or the team.
The target environment to run tests against
Configuration for the browser and test runtime.
A function that runs before all tests. May return a function that will run after all tests are done.
Use this to set up a database, create a user, etc.
A function that runs after all tests are done.
Filter to only run tests with a title matching one of the patterns. For
example, passing grep: /cart/
should only run tests with “cart” in the title.
Also available in the command line with the -g
option. The regular expression
will be tested against the string that consists of the target name, path of
the test file, title of the test and tags starting with @
.
e.g. staging configure-dashboard.yaml "Configure dashboard" @dashboard @data-modification
Filter to only run tests with a title not matching one of the patterns.
This is the opposite of Config.grep
. Also available in the command line with the --grep-invert
option.
Number of tests to run in parallel.
| gotoWaitUntil | load
, domcontentloaded
, networkidle
,commit
. Default is load
. Refer to Playwright docs |
| stepTimeout | Fail test if step takes longer than defined timeout unless overridden. In case of AI steps it will as much as needed. Default: 5000 milliseconds |
| testTimeout | Fail test if it takes longer than defined timeout. Default: 90000 milliseconds |
Target
Use-cases:
- Run
setup
before all tests to cache login session and reuse it for all tests. - Run tests on multiple environments: staging, canary, prod.
- Run tests on multiple browsers and different viewports: chrome, firefox, edge.
- Run subset of tests based on changes in your codebase: dashboard, user-management.
Target-specific options should be put to Config.targets
, but top-level Config can also define base options shared between all targets.
Short id of the target
The type of the target.
Use
Page will navigate to this URL before the start of the test.
Path to the file with storage state that will be loaded into the browser.
Values that you need to pass to the test script.
Set mask: true
to remove sensitive data from results of tests.
Screen size of the browser.
Fail test if a step takes longer than defined timeout unless overridden. If cache of step is not up-to-date, Inspecter will wait this amount of time before calling AI.
Fail test if goto takes longer than defined timeout.
Fail test if it takes longer than defined timeout.
Other parameters for browser and browser context are available. Read Playwright documentation for more details.