@nx/playwright 22.5.0 → 22.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2025 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2026 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/PLUGIN.md CHANGED
@@ -8,19 +8,11 @@ Check in order (first match wins):
8
8
 
9
9
  | Mode | Detection |
10
10
  | --------- | ------------------------------------------------------------ |
11
- | Atomized | `ciTargetName` in nx.json `@nx/playwright` plugin options |
12
11
  | Inference | `@nx/playwright/plugin` in nx.json plugins array |
13
12
  | Executor | `@nx/playwright:playwright` executor in project.json targets |
14
13
 
15
14
  ## Run Specific Test File
16
15
 
17
- ### Atomized
18
-
19
- ```bash
20
- nx run <project>:<ciTargetName>--<path/to/file.spec.ts>
21
- # Example: nx run my-app-e2e:e2e-ci--src/login.spec.ts
22
- ```
23
-
24
16
  ### Inference
25
17
 
26
18
  ```bash
@@ -35,7 +27,7 @@ nx run <project>:e2e --testFiles=<path/to/file.spec.ts>
35
27
 
36
28
  ## Quick Reference
37
29
 
38
- | Task | Atomized | Inference | Executor |
39
- | ----------- | --------------------------------------- | ---------------------------------- | ----------------------------------------------- |
40
- | Run file | `nx run proj:e2e-ci--path/file.spec.ts` | `nx e2e proj -- path/file.spec.ts` | `nx run proj:e2e --testFiles=path/file.spec.ts` |
41
- | Run pattern | N/A | `nx e2e proj -- --grep="pattern"` | `nx run proj:e2e --grep="pattern"` |
30
+ | Task | Inference | Executor |
31
+ | ----------- | ---------------------------------- | ----------------------------------------------- |
32
+ | Run file | `nx e2e proj -- path/file.spec.ts` | `nx run proj:e2e --testFiles=path/file.spec.ts` |
33
+ | Run pattern | `nx e2e proj -- --grep="pattern"` | `nx run proj:e2e --grep="pattern"` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "22.5.0",
3
+ "version": "22.6.0-beta.0",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -34,14 +34,14 @@
34
34
  "directory": "packages/playwright"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "22.5.0",
38
- "@nx/eslint": "22.5.0",
39
- "@nx/js": "22.5.0",
37
+ "@nx/devkit": "22.6.0-beta.0",
38
+ "@nx/eslint": "22.6.0-beta.0",
39
+ "@nx/js": "22.6.0-beta.0",
40
40
  "tslib": "^2.3.0",
41
41
  "minimatch": "10.1.1"
42
42
  },
43
43
  "devDependencies": {
44
- "nx": "22.5.0"
44
+ "nx": "22.6.0-beta.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@playwright/test": "^1.36.0"
@@ -31,6 +31,7 @@ export interface PlaywrightExecutorSchema {
31
31
  uiHost?: string;
32
32
  uiPort?: number;
33
33
  skipInstall?: boolean;
34
+ cacheDir?: string;
34
35
  }
35
36
  export declare function playwrightExecutor(options: PlaywrightExecutorSchema, context: ExecutorContext): Promise<{
36
37
  success: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"playwright.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/playwright/src/executors/playwright/playwright.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAKhB,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,wBAAwB;IAKvC,OAAO,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,C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C,EACF,IAAI,GACJ,KAAK,GACL,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,eAAe;aAoCM,OAAO;GAKtC;AAkDD,eAAe,kBAAkB,CAAC"}
@@ -21,7 +21,10 @@ async function playwrightExecutor(options, context) {
21
21
  });
22
22
  }
23
23
  const args = createArgs(options);
24
- const p = runPlaywright(args, context.root);
24
+ const env = options.cacheDir
25
+ ? { ...process.env, PWTEST_CACHE_DIR: options.cacheDir }
26
+ : undefined;
27
+ const p = runPlaywright(args, context.root, env);
25
28
  p.stdout.on('data', (message) => {
26
29
  process.stdout.write(message);
27
30
  });
@@ -34,7 +37,7 @@ async function playwrightExecutor(options, context) {
34
37
  });
35
38
  });
36
39
  }
37
- function createArgs(opts, exclude = ['skipInstall']) {
40
+ function createArgs(opts, exclude = ['skipInstall', 'cacheDir']) {
38
41
  const args = [];
39
42
  const { testFiles, ...rest } = opts;
40
43
  if (testFiles) {
@@ -61,12 +64,13 @@ function createArgs(opts, exclude = ['skipInstall']) {
61
64
  }
62
65
  return args;
63
66
  }
64
- function runPlaywright(args, cwd) {
67
+ function runPlaywright(args, cwd, env) {
65
68
  try {
66
69
  const cli = require.resolve('@playwright/test/cli');
67
70
  return (0, child_process_1.fork)(cli, ['test', ...args], {
68
71
  stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
69
72
  cwd,
73
+ ...(env ? { env } : {}),
70
74
  });
71
75
  }
72
76
  catch (e) {
@@ -155,6 +155,10 @@
155
155
  "type": "boolean",
156
156
  "description": "Skip running playwright install before running playwright tests. This is to ensure that playwright browsers are installed before running tests.",
157
157
  "default": false
158
+ },
159
+ "cacheDir": {
160
+ "type": "string",
161
+ "description": "Directory for Playwright internal cache (browser binaries, etc.). Sets the PWTEST_CACHE_DIR environment variable."
158
162
  }
159
163
  },
160
164
  "required": []