@nx/playwright 20.4.0 → 20.4.2
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/generators.json +2 -1
- package/package.json +6 -6
- package/src/plugins/plugin.js +13 -4
package/generators.json
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"init": {
|
|
11
11
|
"factory": "./src/generators/init/init#initGeneratorInternal",
|
|
12
12
|
"schema": "./src/generators/init/schema.json",
|
|
13
|
-
"description": "Initializes a Playwright project in the current workspace"
|
|
13
|
+
"description": "Initializes a Playwright project in the current workspace",
|
|
14
|
+
"hidden": true
|
|
14
15
|
},
|
|
15
16
|
"convert-to-inferred": {
|
|
16
17
|
"factory": "./src/generators/convert-to-inferred/convert-to-inferred",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/playwright",
|
|
3
|
-
"version": "20.4.
|
|
3
|
+
"version": "20.4.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"homepage": "https://nx.dev",
|
|
6
6
|
"private": false,
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
38
|
-
"@nx/devkit": "20.4.
|
|
39
|
-
"@nx/eslint": "20.4.
|
|
40
|
-
"@nx/webpack": "20.4.
|
|
41
|
-
"@nx/vite": "20.4.
|
|
42
|
-
"@nx/js": "20.4.
|
|
38
|
+
"@nx/devkit": "20.4.2",
|
|
39
|
+
"@nx/eslint": "20.4.2",
|
|
40
|
+
"@nx/webpack": "20.4.2",
|
|
41
|
+
"@nx/vite": "20.4.2",
|
|
42
|
+
"@nx/js": "20.4.2",
|
|
43
43
|
"tslib": "^2.3.0",
|
|
44
44
|
"minimatch": "9.0.3"
|
|
45
45
|
},
|
package/src/plugins/plugin.js
CHANGED
|
@@ -273,14 +273,23 @@ function getReporterOutputs(playwrightConfig) {
|
|
|
273
273
|
}
|
|
274
274
|
return outputs;
|
|
275
275
|
}
|
|
276
|
-
function getTargetOutputs(testOutput, reporterOutputs, workspaceRoot, projectRoot,
|
|
276
|
+
function getTargetOutputs(testOutput, reporterOutputs, workspaceRoot, projectRoot, subFolder) {
|
|
277
277
|
const outputs = new Set();
|
|
278
|
-
outputs.add(normalizeOutput(
|
|
278
|
+
outputs.add(normalizeOutput(addSubfolderToOutput(testOutput, subFolder), workspaceRoot, projectRoot));
|
|
279
279
|
for (const [, output] of reporterOutputs) {
|
|
280
|
-
outputs.add(normalizeOutput(
|
|
280
|
+
outputs.add(normalizeOutput(addSubfolderToOutput(output, subFolder), workspaceRoot, projectRoot));
|
|
281
281
|
}
|
|
282
282
|
return Array.from(outputs);
|
|
283
283
|
}
|
|
284
|
+
function addSubfolderToOutput(output, subfolder) {
|
|
285
|
+
if (!subfolder)
|
|
286
|
+
return output;
|
|
287
|
+
const parts = (0, node_path_1.parse)(output);
|
|
288
|
+
if (parts.ext !== '') {
|
|
289
|
+
return (0, node_path_1.join)(parts.dir, subfolder, parts.base);
|
|
290
|
+
}
|
|
291
|
+
return (0, node_path_1.join)(output, subfolder);
|
|
292
|
+
}
|
|
284
293
|
function normalizeOutput(path, workspaceRoot, projectRoot) {
|
|
285
294
|
const fullProjectRoot = (0, node_path_1.resolve)(workspaceRoot, projectRoot);
|
|
286
295
|
const fullPath = (0, node_path_1.resolve)(fullProjectRoot, path);
|
|
@@ -296,7 +305,7 @@ function getOutputEnvVars(reporterOutputs, outputSubfolder) {
|
|
|
296
305
|
if (outputSubfolder) {
|
|
297
306
|
const isFile = (0, node_path_1.parse)(output).ext !== '';
|
|
298
307
|
const envVarName = `PLAYWRIGHT_${reporter.toUpperCase()}_OUTPUT_${isFile ? 'FILE' : 'DIR'}`;
|
|
299
|
-
env[envVarName] = (
|
|
308
|
+
env[envVarName] = addSubfolderToOutput(output, outputSubfolder);
|
|
300
309
|
// Also set PLAYWRIGHT_HTML_REPORT for Playwright prior to 1.45.0.
|
|
301
310
|
// HTML prior to this version did not follow the pattern of "PLAYWRIGHT_<REPORTER>_OUTPUT_<FILE|DIR>".
|
|
302
311
|
if (reporter === 'html') {
|