Skip to content

The @nx/playwright plugin provides various executors to help you create and configure playwright projects within your Nx workspace. Below is a complete reference for all available executors and their options.

playwright

Run Playwright tests.

Options

OptionTypeDescriptionDefault
browserstringBrowser to use for tests, one of ‘all’, ‘chromium’, ‘firefox’ or ‘webkit’. If a playwright config is provided/discovered then the browserName value is expected from the configured ‘projects’
configstringConfiguration file, or a test directory with optional
debugbooleanRun tests with Playwright Inspector. Shortcut for ‘PWDEBUG=1’ environment variable and ‘—timeout=0’,—max-failures=1 —headed —workers=1’ options
forbidOnlybooleanFail if test.only is called
fullyParallelbooleanRun all tests in parallel
globalTimeoutnumberMaximum time this test suite can run in milliseconds
grepstringOnly run tests matching this regular expression
grepInvertstringOnly run tests that do not match this regular expression
headedbooleanRun tests in headed browsers
ignoreSnapshotsbooleanIgnore screenshot and snapshot expectations
lastFailedbooleanRun only the tests that failed in the last run
listbooleanCollect all the tests and report them, but do not run
maxFailuresstringStop after the first N failures
noDepsbooleanDo not run project dependencies
outputstringFolder for output artifacts
passWithNoTestsbooleanMakes test run succeed even if no tests were foundtrue
projectarrayOnly run tests from the specified list of projects
quietbooleanSuppress stdio
repeatEachnumberRun each test N times
reporterstringCommon Reporter values to use, comma-separated, ‘list’, ‘line’, ‘dot’, ‘json’, ‘junit’, ‘null’, ‘github’, ‘html’, ‘blob’. To configure reporter options, use the playwright configuration.
retriesnumberMaximum retry count for flaky tests, zero for no retries
shardstringShard tests and execute only the selected shard, specify in the form ‘current/all’, 1-based, for example ‘3/5’
skipInstallbooleanSkip running playwright install before running playwright tests. This is to ensure that playwright browsers are installed before running tests.false
testFilesarrayTest files to run
timeoutnumberSpecify test timeout threshold in milliseconds, zero for unlimited
tracestringForce tracing mode, can be ‘on’, ‘off’, ‘on-first-retry’, ‘on-all-retries’, ‘retain-on-failure’
uibooleanRun tests in interactive UI mode
uiHoststringHost to serve UI on; specifying this option opens UI in a browser tab
uiPortnumberPort to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab
updateSnapshotsbooleanUpdate snapshots with actual results. Snapshots will be created if missing.
workersstringNumber of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker