@nx/playwright - Generators
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.
For an overview of the plugin and setup instructions, see the @nx/playwright introduction.
configuration
Section titled “configuration”Add a Playwright configuration.
Usage:
nx generate @nx/playwright:configuration [options]Options
Section titled “Options”| Option | Type | Description | Default |
|---|---|---|---|
--project | string [required] | The project to add a Playwright configuration to. | |
--directory | string | A directory where the project is placed relative from the project root. | "e2e" |
--enableTypedLinting | boolean | Whether to enable typed linting. For flat configs, this configures the recommended parserOptions.projectService and tsconfigRootDir. For legacy .eslintrc configs, this configures parserOptions.project. We do not enable this by default for lint performance reasons. | false |
--js | boolean | Generate JavaScript files rather than TypeScript files. | false |
--linter | string | The tool to use for running lint checks. | |
--rootProject | boolean | Create a application at the root of the workspace | false |
--setParserOptionsProject | boolean | Deprecated alias for enableTypedLinting. | false |
--skipFormat | boolean | Skip formatting files. | false |
--skipInstall | boolean | Skip running playwright install. This is to ensure that playwright browsers are installed. | false |
--skipPackageJson | boolean | Do not add dependencies to package.json. | false |
--webServerAddress | string | The address of the web server. | |
--webServerCommand | string | The command to start the web server. |
convert-to-inferred
Section titled “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:
nx generate @nx/playwright:convert-to-inferred [options]Options
Section titled “Options”| Option | Type | Description | Default |
|---|---|---|---|
--project | string | The project to convert from using the @nx/playwright:playwright executor to use @nx/playwright/plugin. | |
--skipFormat | boolean | Whether to format files at the end of the migration. | false |
Getting Help
Section titled “Getting Help”You can get help for any generator by adding the --help flag:
nx generate @nx/playwright:<generator> --help