@trackunit/iris-app-e2e 1.8.8 → 1.8.9-alpha-e76d0654d61.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/index.cjs.js +21 -16
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -5,7 +5,10 @@ var path = require('path');
|
|
|
5
5
|
var crypto = require('crypto');
|
|
6
6
|
var nodeXlsx = require('node-xlsx');
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
9
12
|
var n = Object.create(null);
|
|
10
13
|
if (e) {
|
|
11
14
|
Object.keys(e).forEach(function (k) {
|
|
@@ -22,7 +25,9 @@ function _interopNamespaceDefault(e) {
|
|
|
22
25
|
return Object.freeze(n);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
var
|
|
28
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
29
|
+
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
30
|
+
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* Sets up default Cypress commands for E2E testing.
|
|
@@ -194,9 +199,9 @@ const isNetworkCall = (log) => {
|
|
|
194
199
|
*/
|
|
195
200
|
function createLogFile(nxRoot, logsPath, fileNameWithoutExtension, logs, logWriter) {
|
|
196
201
|
if (!fs.existsSync(logsPath)) {
|
|
197
|
-
|
|
202
|
+
fs__default.default.mkdirSync(logsPath, { recursive: true });
|
|
198
203
|
}
|
|
199
|
-
const logFilePath =
|
|
204
|
+
const logFilePath = path__namespace.default.join(logsPath, fileNameWithoutExtension);
|
|
200
205
|
writeFileWithPrettier(nxRoot, logFilePath + "-all.json", JSON.stringify(logs), { flag: "a" }, logWriter);
|
|
201
206
|
const errorCmds = logs.filter(log => log.severity === "error" &&
|
|
202
207
|
// This seems to be when apollo has cancelled requests it marks it as failed to fetch only on cypress ?!??
|
|
@@ -319,13 +324,13 @@ const getCodeowner = (currentPath, workspaceRoot, codeownersFileName = "TEAM_COD
|
|
|
319
324
|
if (!workspaceRoot) {
|
|
320
325
|
return undefined;
|
|
321
326
|
}
|
|
322
|
-
const codeownersPath =
|
|
323
|
-
if (!
|
|
327
|
+
const codeownersPath = path__namespace.default.join(workspaceRoot, codeownersFileName);
|
|
328
|
+
if (!fs__default.default.existsSync(codeownersPath)) {
|
|
324
329
|
return undefined;
|
|
325
330
|
}
|
|
326
|
-
const codeownersLines =
|
|
331
|
+
const codeownersLines = fs__default.default.readFileSync(codeownersPath, "utf8").split("\n");
|
|
327
332
|
const codeowners = parseCodeowners(codeownersLines);
|
|
328
|
-
let relPath =
|
|
333
|
+
let relPath = path__namespace.default
|
|
329
334
|
.relative(workspaceRoot, currentPath)
|
|
330
335
|
.replace(/\\/g, "/")
|
|
331
336
|
.replace(/^\/+|\/+$/g, "");
|
|
@@ -335,7 +340,7 @@ const getCodeowner = (currentPath, workspaceRoot, codeownersFileName = "TEAM_COD
|
|
|
335
340
|
if (codeowner) {
|
|
336
341
|
return codeowner;
|
|
337
342
|
}
|
|
338
|
-
const parent =
|
|
343
|
+
const parent = path__namespace.default.posix.dirname(relPath);
|
|
339
344
|
if ((parent === relPath || parent === ".") && codeowners["."]) {
|
|
340
345
|
return codeowners["."];
|
|
341
346
|
}
|
|
@@ -391,11 +396,11 @@ function fileNameBuilder(testName, state, currentRetry) {
|
|
|
391
396
|
*/
|
|
392
397
|
function findWorkspaceRoot(startDir = process.cwd()) {
|
|
393
398
|
let currentDir = startDir;
|
|
394
|
-
while (currentDir !==
|
|
395
|
-
if (fs.existsSync(
|
|
399
|
+
while (currentDir !== path__namespace.default.dirname(currentDir)) {
|
|
400
|
+
if (fs.existsSync(path__namespace.default.join(currentDir, "nx.json")) || fs.existsSync(path__namespace.default.join(currentDir, "workspace.json"))) {
|
|
396
401
|
return currentDir;
|
|
397
402
|
}
|
|
398
|
-
currentDir =
|
|
403
|
+
currentDir = path__namespace.default.dirname(currentDir);
|
|
399
404
|
}
|
|
400
405
|
throw new Error("Could not find NX workspace root (nx.json or workspace.json not found)");
|
|
401
406
|
}
|
|
@@ -411,16 +416,16 @@ const defaultCypressConfig = optionsOrDirname => {
|
|
|
411
416
|
const nxRoot = providedNxRoot ?? findWorkspaceRoot();
|
|
412
417
|
// For output path calculation, determine the relative path from caller to workspace root
|
|
413
418
|
const callerDirname = typeof optionsOrDirname === "string" ? optionsOrDirname : process.cwd();
|
|
414
|
-
const relativePath =
|
|
419
|
+
const relativePath = path__namespace.default.relative(nxRoot, callerDirname);
|
|
415
420
|
const dotsToNxRoot = relativePath
|
|
416
|
-
.split(
|
|
421
|
+
.split(path__namespace.default.sep)
|
|
417
422
|
.map(_ => "..")
|
|
418
423
|
.join("/");
|
|
419
424
|
const envOutputDirOverride = process.env.NX_E2E_OUTPUT_DIR || outputDirOverride;
|
|
420
425
|
// Function to build output paths that respects the override
|
|
421
426
|
const buildOutputPath = (subPath) => {
|
|
422
427
|
if (envOutputDirOverride) {
|
|
423
|
-
return
|
|
428
|
+
return path__namespace.default.join(dotsToNxRoot, envOutputDirOverride, subPath);
|
|
424
429
|
}
|
|
425
430
|
return `${dotsToNxRoot}/dist/cypress/${relativePath}/${subPath}`;
|
|
426
431
|
};
|
|
@@ -458,7 +463,7 @@ const defaultCypressConfig = optionsOrDirname => {
|
|
|
458
463
|
screenshotsFolder: pluginConfig.screenshotsFolder ?? buildOutputPath("screenshots"),
|
|
459
464
|
env: {
|
|
460
465
|
hars_folders: pluginConfig.harFolder ?? buildOutputPath("hars"),
|
|
461
|
-
CYPRESS_RUN_UNIQUE_ID:
|
|
466
|
+
CYPRESS_RUN_UNIQUE_ID: crypto__default.default.randomUUID(),
|
|
462
467
|
},
|
|
463
468
|
};
|
|
464
469
|
};
|