diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index 68a88bd7bc..922f265561 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -6814,6 +6814,57 @@ "isExternal": false, "disableCollapsible": false }, + { + "id": "playwright", + "path": "/packages/playwright", + "name": "playwright", + "children": [ + { + "id": "executors", + "path": "/packages/playwright/executors", + "name": "executors", + "children": [ + { + "id": "playwright", + "path": "/packages/playwright/executors/playwright", + "name": "playwright", + "children": [], + "isExternal": false, + "disableCollapsible": false + } + ], + "isExternal": false, + "disableCollapsible": false + }, + { + "id": "generators", + "path": "/packages/playwright/generators", + "name": "generators", + "children": [ + { + "id": "configuration", + "path": "/packages/playwright/generators/configuration", + "name": "configuration", + "children": [], + "isExternal": false, + "disableCollapsible": false + }, + { + "id": "init", + "path": "/packages/playwright/generators/init", + "name": "init", + "children": [], + "isExternal": false, + "disableCollapsible": false + } + ], + "isExternal": false, + "disableCollapsible": false + } + ], + "isExternal": false, + "disableCollapsible": false + }, { "id": "plugin", "path": "/packages/plugin", diff --git a/docs/generated/manifests/packages.json b/docs/generated/manifests/packages.json index 51f7c15ee2..6d48ade5dd 100644 --- a/docs/generated/manifests/packages.json +++ b/docs/generated/manifests/packages.json @@ -1833,6 +1833,47 @@ "generators": {}, "path": "/packages/nx" }, + "playwright": { + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "playwright", + "packageName": "@nx/playwright", + "description": "The Nx Plugin for Playwright contains executors and generators allowing your workspace to use the powerful Playwright integration testing capabilities.", + "documents": {}, + "root": "/packages/playwright", + "source": "/packages/playwright/src", + "executors": { + "/packages/playwright/executors/playwright": { + "description": "Run Playwright tests.", + "file": "generated/packages/playwright/executors/playwright.json", + "hidden": false, + "name": "playwright", + "originalFilePath": "/packages/playwright/src/executors/playwright/schema.json", + "path": "/packages/playwright/executors/playwright", + "type": "executor" + } + }, + "generators": { + "/packages/playwright/generators/configuration": { + "description": "Add Nx Playwright configuration to your project", + "file": "generated/packages/playwright/generators/configuration.json", + "hidden": false, + "name": "configuration", + "originalFilePath": "/packages/playwright/src/generators/configuration/schema.json", + "path": "/packages/playwright/generators/configuration", + "type": "generator" + }, + "/packages/playwright/generators/init": { + "description": "Initializes a Playwright project in the current workspace", + "file": "generated/packages/playwright/generators/init.json", + "hidden": false, + "name": "init", + "originalFilePath": "/packages/playwright/src/generators/init/schema.json", + "path": "/packages/playwright/generators/init", + "type": "generator" + } + }, + "path": "/packages/playwright" + }, "plugin": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "plugin", diff --git a/docs/generated/packages-metadata.json b/docs/generated/packages-metadata.json index 035ee02fa3..1b421c7dc6 100644 --- a/docs/generated/packages-metadata.json +++ b/docs/generated/packages-metadata.json @@ -1816,6 +1816,46 @@ "root": "/packages/nx", "source": "/packages/nx/src" }, + { + "description": "The Nx Plugin for Playwright contains executors and generators allowing your workspace to use the powerful Playwright integration testing capabilities.", + "documents": [], + "executors": [ + { + "description": "Run Playwright tests.", + "file": "generated/packages/playwright/executors/playwright.json", + "hidden": false, + "name": "playwright", + "originalFilePath": "/packages/playwright/src/executors/playwright/schema.json", + "path": "playwright/executors/playwright", + "type": "executor" + } + ], + "generators": [ + { + "description": "Add Nx Playwright configuration to your project", + "file": "generated/packages/playwright/generators/configuration.json", + "hidden": false, + "name": "configuration", + "originalFilePath": "/packages/playwright/src/generators/configuration/schema.json", + "path": "playwright/generators/configuration", + "type": "generator" + }, + { + "description": "Initializes a Playwright project in the current workspace", + "file": "generated/packages/playwright/generators/init.json", + "hidden": false, + "name": "init", + "originalFilePath": "/packages/playwright/src/generators/init/schema.json", + "path": "playwright/generators/init", + "type": "generator" + } + ], + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "playwright", + "packageName": "@nx/playwright", + "root": "/packages/playwright", + "source": "/packages/playwright/src" + }, { "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.", "documents": [ diff --git a/docs/generated/packages/playwright/executors/playwright.json b/docs/generated/packages/playwright/executors/playwright.json new file mode 100644 index 0000000000..3d629fe8d9 --- /dev/null +++ b/docs/generated/packages/playwright/executors/playwright.json @@ -0,0 +1,163 @@ +{ + "name": "playwright", + "implementation": "/packages/playwright/src/executors/playwright/playwright.ts", + "schema": { + "$schema": "http://json-schema.org/schema", + "version": 2, + "title": "Playwright executor", + "description": "Run Playwright tests.", + "type": "object", + "properties": { + "browser": { + "type": "string", + "description": "Browser 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'", + "x-priority": "important" + }, + "config": { + "type": "string", + "description": "Configuration file, or a test directory with optional", + "x-completion-type": "file", + "x-completion-glob": "playwright?(*)@(.js|.cjs|.mjs|.ts|.cts|.mtx)", + "x-priority": "important" + }, + "debug": { + "type": "boolean", + "description": "Run tests with Playwright Inspector. Shortcut for 'PWDEBUG=1' environment variable and '--timeout=0',--max-failures=1 --headed --workers=1' options" + }, + "forbidOnly": { + "type": "boolean", + "description": "Fail if test.only is called" + }, + "fullyParallel": { + "type": "boolean", + "description": "Run all tests in parallel" + }, + "grep": { + "alias": "g", + "type": "string", + "description": "Only run tests matching this regular expression" + }, + "globalTimeout": { + "type": "number", + "description": "Maximum time this test suite can run in milliseconds" + }, + "grepInvert": { + "alias": "gv", + "type": "string", + "description": "Only run tests that do not match this regular expression" + }, + "headed": { + "type": "boolean", + "description": "Run tests in headed browsers", + "x-priority": "important" + }, + "ignoreSnapshots": { + "type": "boolean", + "description": "Ignore screenshot and snapshot expectations" + }, + "workers": { + "alias": "j", + "type": "string", + "description": "Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker" + }, + "list": { + "type": "boolean", + "description": "Collect all the tests and report them, but do not run" + }, + "maxFailures": { + "alias": "x", + "oneOf": [{ "type": "number" }, { "type": "boolean" }], + "description": "Stop after the first N failures" + }, + "noDeps": { + "type": "boolean", + "description": "Do not run project dependencies" + }, + "output": { + "type": "string", + "description": "Folder for output artifacts" + }, + "passWithNoTests": { + "type": "boolean", + "description": "Makes test run succeed even if no tests were found", + "default": true + }, + "project": { + "description": "Only run tests from the specified list of projects", + "type": "array", + "items": { "type": "string" } + }, + "quiet": { + "alias": "q", + "type": "boolean", + "description": "Suppress stdio" + }, + "repeatEach": { + "type": "number", + "description": "Run each test N times" + }, + "reporter": { + "type": "string", + "enum": [ + "list", + "line", + "dot", + "json", + "junit", + "null", + "github", + "html", + "blob" + ], + "description": "Reporter to use, comma-separated, can be 'list', 'line', 'dot', 'json', 'junit', 'null', 'github', 'html', 'blob'. To configure reporter options, use the playwright configuration." + }, + "retries": { + "type": "number", + "description": "Maximum retry count for flaky tests, zero for no retries" + }, + "shard": { + "type": "string", + "description": "Shard tests and execute only the selected shard, specify in the form 'current/all', 1-based, for example '3/5'" + }, + "timeout": { + "type": "number", + "description": "Specify test timeout threshold in milliseconds, zero for unlimited" + }, + "trace": { + "type": "string", + "enum": [ + "on", + "off", + "on-first-retry", + "on-all-retries", + "retain-on-failure" + ], + "description": "Force tracing mode, can be 'on', 'off', 'on-first-retry', 'on-all-retries', 'retain-on-failure'" + }, + "updateSnapshots": { + "alias": "u", + "type": "boolean", + "description": "Update snapshots with actual results. Snapshots will be created if missing." + }, + "ui": { + "type": "boolean", + "description": "Run tests in interactive UI mode" + }, + "uiHost": { + "type": "string", + "description": "Host to serve UI on; specifying this option opens UI in a browser tab" + }, + "uiPort": { + "type": "string", + "description": "Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab" + } + }, + "required": [], + "presets": [] + }, + "description": "Run Playwright tests.", + "aliases": [], + "hidden": false, + "path": "/packages/playwright/src/executors/playwright/schema.json", + "type": "executor" +} diff --git a/docs/generated/packages/playwright/generators/configuration.json b/docs/generated/packages/playwright/generators/configuration.json new file mode 100644 index 0000000000..432fa5c2a5 --- /dev/null +++ b/docs/generated/packages/playwright/generators/configuration.json @@ -0,0 +1,70 @@ +{ + "name": "configuration", + "factory": "./src/generators/configuration/configuration", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxPlaywrightConfiguration", + "description": "Add a Playwright configuration.", + "title": "Add a Playwright configuration", + "type": "object", + "properties": { + "project": { + "type": "string", + "description": "The project to add a Playwright configuration to", + "$default": { "$source": "projectName" }, + "x-priority": "important", + "x-prompt": "What is the name of the project to set up Playwright for?" + }, + "directory": { + "type": "string", + "description": "A directory where the project is placed relative from the project root", + "x-priority": "important", + "default": "playwright" + }, + "js": { + "type": "boolean", + "description": "Generate JavaScript files rather than TypeScript files.", + "default": false + }, + "webServerCommand": { + "type": "string", + "description": "The command to start the web server." + }, + "webServerAddress": { + "type": "string", + "description": "The address of the web server." + }, + "linter": { + "description": "The tool to use for running lint checks.", + "type": "string", + "enum": ["eslint", "none"], + "default": "eslint" + }, + "setParserOptionsProject": { + "type": "boolean", + "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", + "default": false + }, + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false, + "x-priority": "internal" + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`.", + "x-priority": "internal" + } + }, + "required": ["project"], + "presets": [] + }, + "description": "Add Nx Playwright configuration to your project", + "implementation": "/packages/playwright/src/generators/configuration/configuration.ts", + "aliases": [], + "hidden": false, + "path": "/packages/playwright/src/generators/configuration/schema.json", + "type": "generator" +} diff --git a/docs/generated/packages/playwright/generators/init.json b/docs/generated/packages/playwright/generators/init.json new file mode 100644 index 0000000000..d658115c08 --- /dev/null +++ b/docs/generated/packages/playwright/generators/init.json @@ -0,0 +1,33 @@ +{ + "name": "init", + "factory": "./src/generators/init/init", + "schema": { + "$schema": "http://json-schema.org/schema", + "$id": "NxPlaywrightInit", + "title": "Playwright Init Generator", + "description": "Initializes a Playwright project in the current workspace.", + "type": "object", + "properties": { + "skipFormat": { + "description": "Skip formatting files.", + "type": "boolean", + "default": false, + "x-priority": "internal" + }, + "skipPackageJson": { + "type": "boolean", + "default": false, + "description": "Do not add dependencies to `package.json`.", + "x-priority": "internal" + } + }, + "required": [], + "presets": [] + }, + "description": "Initializes a Playwright project in the current workspace", + "implementation": "/packages/playwright/src/generators/init/init.ts", + "aliases": [], + "hidden": false, + "path": "/packages/playwright/src/generators/init/schema.json", + "type": "generator" +} diff --git a/docs/shared/reference/sitemap.md b/docs/shared/reference/sitemap.md index b229f82f3d..e57fd5617f 100644 --- a/docs/shared/reference/sitemap.md +++ b/docs/shared/reference/sitemap.md @@ -481,6 +481,12 @@ - [noop](/packages/nx/executors/noop) - [run-commands](/packages/nx/executors/run-commands) - [run-script](/packages/nx/executors/run-script) + - [playwright](/packages/playwright) + - [executors](/packages/playwright/executors) + - [playwright](/packages/playwright/executors/playwright) + - [generators](/packages/playwright/generators) + - [configuration](/packages/playwright/generators/configuration) + - [init](/packages/playwright/generators/init) - [plugin](/packages/plugin) - [documents](/packages/plugin/documents) - [Overview](/packages/plugin/documents/overview) diff --git a/nx-dev/nx-dev/public/images/icons/playwright.svg b/nx-dev/nx-dev/public/images/icons/playwright.svg new file mode 100644 index 0000000000..a963d08b68 --- /dev/null +++ b/nx-dev/nx-dev/public/images/icons/playwright.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/nx-dev/ui-references/src/lib/icons-map.ts b/nx-dev/ui-references/src/lib/icons-map.ts index ef50ec7fbb..0827c58c28 100644 --- a/nx-dev/ui-references/src/lib/icons-map.ts +++ b/nx-dev/ui-references/src/lib/icons-map.ts @@ -16,6 +16,7 @@ export const iconsMap: Record = { next: '/images/icons/nextdotjs.svg', node: '/images/icons/nodedotjs.svg', nx: '/images/icons/nx.svg', + playwright: '/images/icons/playwright.svg', plugin: '/images/icons/nx.svg', react: '/images/icons/react.svg', 'react-native': '/images/icons/react.svg', diff --git a/packages/playwright/package.json b/packages/playwright/package.json index 5f76a1e983..731199315b 100644 --- a/packages/playwright/package.json +++ b/packages/playwright/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "type": "commonjs", "homepage": "https://nx.dev", - "private": true, + "private": false, "description": "The Nx Plugin for Playwright contains executors and generators allowing your workspace to use the powerful Playwright integration testing capabilities.", "keywords": [ "Monorepo", @@ -42,5 +42,15 @@ } }, "executors": "./executors.json", - "generators": "./generators.json" + "generators": "./generators.json", + "exports": { + ".": "./index.js", + "./package.json": "./package.json", + "./migrations.json": "./migrations.json", + "./generators.json": "./generators.json", + "./generators/*/schema.json": "./src/generators/*/schema.json", + "./executors.json": "./executors.json", + "./executors/*/schema.json": "./src/executors/*/schema.json", + "./preset": "./src/utils/preset.js" + } }