testDir: specify your test case path(location)
fullyParallel: run tests in files in parallel.
forbidOnly: fail the build on CI if you accidentally left the test. Only in the source code.
retires: retry the text case execution if it fails. Based on the retry count.
Workers
reporters
Timeout
expect with timeout : expect:{timeout: 5000}
Use with trace and headless
project with name and use
Note: Instead of hard-coding your base URL multiple times, you can add it to the playwright configuration.
use:{
baseUrl:"[<https://localhost:3000>](<https://localhost:3000/>)",
launchOptions:{
sloMo:1_000
}
}
By default, test files are run in parallel. Tests in a single file are run in order, in the same worker process. If we don't enable fully parallel or configure our spec files or worker process limit, the playwright will try to parallelise the spec file, but run the tests included in the spec file sequentially. But to make your tests run as quickly as possible, it is a good habit to turn on full parallelism.
serial mode: you can annotate inter-dependent test cases as serial. If one of the serial tests fails, all subsequent tests are skipped. All tests in a group are retried together. example: setup.describe.configure({ mode: "serial" });
If you enable fully parallel and serial mode in some test files, if any test case fails, then all the following test cases won't be executed. Note: Using serial is not recommended. It is usually better to make your tests isolated, so they can be run independently.
default: single test failure