Skip to content

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

configuration

Add a Playwright configuration.

Usage:

Terminal window
nx generate @nx/playwright:configuration [options]

Options

OptionTypeDescriptionDefault
--projectstring [required]The project to add a Playwright configuration to.
--directorystringA directory where the project is placed relative from the project root."e2e"
--jsbooleanGenerate JavaScript files rather than TypeScript files.false
--linterstringThe tool to use for running lint checks.
--rootProjectbooleanCreate a application at the root of the workspacefalse
--setParserOptionsProjectbooleanWhether or not to configure the ESLint parserOptions.project option. We do not do this by default for lint performance reasons.false
--skipFormatbooleanSkip formatting files.false
--skipInstallbooleanSkip running playwright install. This is to ensure that playwright browsers are installed.false
--skipPackageJsonbooleanDo not add dependencies to package.json.false
--webServerAddressstringThe address of the web server.
--webServerCommandstringThe command to start the web server.

convert-to-inferred

Convert existing Playwright project(s) using @nx/playwright:playwright executor to use @nx/playwright/plugin. Defaults to migrating all projects. Pass ‘—project’ to migrate only one target.

Usage:

Terminal window
nx generate @nx/playwright:convert-to-inferred [options]

Options

OptionTypeDescriptionDefault
--projectstringThe project to convert from using the @nx/playwright:playwright executor to use @nx/playwright/plugin.
--skipFormatbooleanWhether to format files at the end of the migration.false

Getting Help

You can get help for any generator by adding the --help flag:

Terminal window
nx generate @nx/playwright:<generator> --help