@nx/playwright 17.3.0-beta.5 → 17.3.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "17.3.0-beta.5",
3
+ "version": "17.3.0-beta.6",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -32,11 +32,11 @@
32
32
  "directory": "packages/playwright"
33
33
  },
34
34
  "dependencies": {
35
- "@nx/devkit": "17.3.0-beta.5",
36
- "@nx/eslint": "17.3.0-beta.5",
37
- "@nx/js": "17.3.0-beta.5",
35
+ "@nx/devkit": "17.3.0-beta.6",
36
+ "@nx/eslint": "17.3.0-beta.6",
37
+ "@nx/js": "17.3.0-beta.6",
38
38
  "tslib": "^2.3.0",
39
- "minimatch": "3.0.5"
39
+ "minimatch": "9.0.3"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@playwright/test": "^1.36.0"
@@ -1,4 +1,4 @@
1
- import { defineConfig } from '@playwright/test';
1
+ import { defineConfig, devices } from '@playwright/test';
2
2
  import { nxE2EPreset } from '@nx/playwright/preset';
3
3
  <% if(!webServerCommand || !webServerAddress) { %>// eslint-disable-next-line @typescript-eslint/no-unused-vars <% } %>
4
4
  import { workspaceRoot } from '@nx/devkit';
@@ -35,4 +35,40 @@ export default defineConfig({
35
35
  // reuseExistingServer: !process.env.CI,
36
36
  // cwd: workspaceRoot,
37
37
  // },<% } %>
38
+ projects: [
39
+ {
40
+ name: "chromium",
41
+ use: { ...devices["Desktop Chrome"] },
42
+ },
43
+
44
+ {
45
+ name: "firefox",
46
+ use: { ...devices["Desktop Firefox"] },
47
+ },
48
+
49
+ {
50
+ name: "webkit",
51
+ use: { ...devices["Desktop Safari"] },
52
+ },
53
+
54
+ // Uncomment for mobile browsers support
55
+ /* {
56
+ name: 'Mobile Chrome',
57
+ use: { ...devices['Pixel 5'] },
58
+ },
59
+ {
60
+ name: 'Mobile Safari',
61
+ use: { ...devices['iPhone 12'] },
62
+ }, */
63
+
64
+ // Uncomment for branded browsers
65
+ /* {
66
+ name: 'Microsoft Edge',
67
+ use: { ...devices['Desktop Edge'], channel: 'msedge' },
68
+ },
69
+ {
70
+ name: 'Google Chrome',
71
+ use: { ...devices['Desktop Chrome'], channel: 'chrome' },
72
+ } */
73
+ ],
38
74
  });
@@ -9,7 +9,7 @@ async function initGenerator(tree, options) {
9
9
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
10
10
  '@nx/playwright': versions_1.nxVersion,
11
11
  '@playwright/test': versions_1.playwrightVersion,
12
- }));
12
+ }, undefined, options.keepExistingVersions));
13
13
  }
14
14
  if (process.env.NX_PCV3 === 'true') {
15
15
  addPlugin(tree);
@@ -1,4 +1,5 @@
1
1
  export interface InitGeneratorSchema {
2
- skipFormat: boolean;
3
- skipPackageJson: boolean;
2
+ skipFormat?: boolean;
3
+ skipPackageJson?: boolean;
4
+ keepExistingVersions?: boolean;
4
5
  }
@@ -16,6 +16,12 @@
16
16
  "default": false,
17
17
  "description": "Do not add dependencies to `package.json`.",
18
18
  "x-priority": "internal"
19
+ },
20
+ "keepExistingVersions": {
21
+ "type": "boolean",
22
+ "x-priority": "internal",
23
+ "description": "Keep existing dependencies versions",
24
+ "default": false
19
25
  }
20
26
  },
21
27
  "required": []
@@ -7,7 +7,7 @@ const devkit_1 = require("@nx/devkit");
7
7
  const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
8
8
  const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
9
9
  const workspace_context_1 = require("nx/src/utils/workspace-context");
10
- const minimatch = require("minimatch");
10
+ const minimatch_1 = require("minimatch");
11
11
  const load_config_file_1 = require("../utils/load-config-file");
12
12
  const cache_directory_1 = require("nx/src/utils/cache-directory");
13
13
  const js_1 = require("@nx/js");
@@ -136,7 +136,7 @@ function createMatcher(pattern) {
136
136
  else {
137
137
  return (path) => {
138
138
  try {
139
- return minimatch(path, pattern);
139
+ return (0, minimatch_1.minimatch)(path, pattern);
140
140
  }
141
141
  catch (e) {
142
142
  throw new Error(`Error matching ${path} with ${pattern}: ${e.message}`);
@@ -4,16 +4,6 @@ export interface NxPlaywrightOptions {
4
4
  * @default './src'
5
5
  **/
6
6
  testDir?: string;
7
- /**
8
- * Include Mobile Chome and Mobile Safari browsers in test projects
9
- * @default false
10
- **/
11
- includeMobileBrowsers?: boolean;
12
- /**
13
- * Include Microsoft Edge and Google Chrome browsers in test projects
14
- * @default false
15
- **/
16
- includeBrandedBrowsers?: boolean;
17
7
  }
18
8
  /**
19
9
  * nx E2E Preset for Playwright
@@ -25,6 +15,7 @@ export interface NxPlaywrightOptions {
25
15
  * - chromium
26
16
  * - firefox
27
17
  * - webkit
18
+ * These are generated by default.
28
19
  *
29
20
  * you can easily extend this within your playwright config via spreading the preset
30
21
  * @example
@@ -15,6 +15,7 @@ const test_1 = require("@playwright/test");
15
15
  * - chromium
16
16
  * - firefox
17
17
  * - webkit
18
+ * These are generated by default.
18
19
  *
19
20
  * you can easily extend this within your playwright config via spreading the preset
20
21
  * @example
@@ -34,44 +35,6 @@ function nxE2EPreset(pathToConfig, options) {
34
35
  const offset = (0, node_path_1.relative)(normalizedPath, devkit_1.workspaceRoot);
35
36
  const testResultOuputDir = (0, node_path_1.join)(offset, 'dist', '.playwright', projectPath, 'test-output');
36
37
  const reporterOutputDir = (0, node_path_1.join)(offset, 'dist', '.playwright', projectPath, 'playwright-report');
37
- const projects = [
38
- {
39
- name: 'chromium',
40
- use: { ...test_1.devices['Desktop Chrome'] },
41
- },
42
- {
43
- name: 'firefox',
44
- use: { ...test_1.devices['Desktop Firefox'] },
45
- },
46
- {
47
- name: 'webkit',
48
- use: { ...test_1.devices['Desktop Safari'] },
49
- },
50
- ];
51
- if (options?.includeMobileBrowsers) {
52
- projects.push(...[
53
- {
54
- name: 'Mobile Chrome',
55
- use: { ...test_1.devices['Pixel 5'] },
56
- },
57
- {
58
- name: 'Mobile Safari',
59
- use: { ...test_1.devices['iPhone 12'] },
60
- },
61
- ]);
62
- }
63
- if (options?.includeBrandedBrowsers) {
64
- projects.push(...[
65
- {
66
- name: 'Microsoft Edge',
67
- use: { ...test_1.devices['Desktop Edge'], channel: 'msedge' },
68
- },
69
- {
70
- name: 'Google Chrome',
71
- use: { ...test_1.devices['Desktop Chrome'], channel: 'chrome' },
72
- },
73
- ]);
74
- }
75
38
  return (0, test_1.defineConfig)({
76
39
  testDir: options?.testDir ?? './src',
77
40
  outputDir: testResultOuputDir,
@@ -92,7 +55,6 @@ function nxE2EPreset(pathToConfig, options) {
92
55
  },
93
56
  ],
94
57
  ],
95
- projects,
96
58
  });
97
59
  }
98
60
  exports.nxE2EPreset = nxE2EPreset;