dceky 1.1.1 → 1.1.3
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/docs/commands.html +961 -0
- package/genDocs/index.ts +322 -0
- package/lib/genDocs/index.d.ts +1 -0
- package/lib/genDocs/index.js +285 -0
- package/lib/genDocs/index.js.map +1 -0
- package/lib/postinstall/helpers/getRootPath.js +3 -3
- package/lib/postinstall/helpers/getRootPath.js.map +1 -1
- package/lib/postinstall/index.js +6 -6
- package/lib/postinstall/index.js.map +1 -1
- package/lib/preinstall/helpers/getRootPath.js +3 -3
- package/lib/preinstall/helpers/getRootPath.js.map +1 -1
- package/lib/preinstall/index.js +6 -6
- package/lib/preinstall/index.js.map +1 -1
- package/lib/setup/addToGitIgnore.js +13 -13
- package/lib/setup/addToGitIgnore.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genEmptyGlobalFile.js +12 -12
- package/lib/setup/checkRequiredFiles/genEmptyGlobalFile.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genEmptyProfileFile.js +23 -13
- package/lib/setup/checkRequiredFiles/genEmptyProfileFile.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genExampleTest.js +8 -8
- package/lib/setup/checkRequiredFiles/genExampleTest.js.map +1 -1
- package/lib/setup/checkRequiredFiles/index.js +21 -21
- package/lib/setup/checkRequiredFiles/index.js.map +1 -1
- package/lib/setup/genCommandImportFile.js +24 -24
- package/lib/setup/genCommandImportFile.js.map +1 -1
- package/lib/setup/genDynamicConfigFile.js +8 -8
- package/lib/setup/genDynamicConfigFile.js.map +1 -1
- package/lib/setup/genE2ELaunchFile.js +8 -8
- package/lib/setup/genE2ELaunchFile.js.map +1 -1
- package/lib/setup/genKyCommandDeclarations.js +24 -24
- package/lib/setup/genKyCommandDeclarations.js.map +1 -1
- package/lib/setup/genTsConfigFile.js +9 -8
- package/lib/setup/genTsConfigFile.js.map +1 -1
- package/lib/setup/helpers/getRootPath.js +3 -3
- package/lib/setup/helpers/getRootPath.js.map +1 -1
- package/lib/setup/index.js +8 -8
- package/lib/setup/index.js.map +1 -1
- package/lib/setup/setupCypressDependencies.js +11 -11
- package/lib/setup/setupCypressDependencies.js.map +1 -1
- package/lib/src/commands/assertDoesNotHaveClass.js +3 -3
- package/lib/src/commands/assertDoesNotHaveClass.js.map +1 -1
- package/lib/src/commands/assertHasClass.js +3 -3
- package/lib/src/commands/assertHasClass.js.map +1 -1
- package/lib/src/commands/assertNumElements.js +3 -3
- package/lib/src/commands/assertNumElements.js.map +1 -1
- package/lib/src/commands/checkIfElementExists.js +3 -3
- package/lib/src/commands/checkIfElementExists.js.map +1 -1
- package/lib/src/commands/extractDataFromClass.js +8 -8
- package/lib/src/commands/extractDataFromClass.js.map +1 -1
- package/lib/src/commands/extractDataFromClassByContents.js +8 -8
- package/lib/src/commands/extractDataFromClassByContents.js.map +1 -1
- package/lib/src/commands/genTextOfLength.js +6 -6
- package/lib/src/commands/genTextOfLength.js.map +1 -1
- package/lib/src/commands/getAttribute.js +4 -4
- package/lib/src/commands/getAttribute.js.map +1 -1
- package/lib/src/commands/getClassName.js +3 -3
- package/lib/src/commands/getClassName.js.map +1 -1
- package/lib/src/commands/getCredentialValue.js +3 -4
- package/lib/src/commands/getCredentialValue.js.map +1 -1
- package/lib/src/commands/getCredentialValues.js +2 -2
- package/lib/src/commands/getCredentialValues.js.map +1 -1
- package/lib/src/commands/getCurrentDateInfo.js +4 -4
- package/lib/src/commands/getCurrentDateInfo.js.map +1 -1
- package/lib/src/commands/getId.js +3 -3
- package/lib/src/commands/getId.js.map +1 -1
- package/lib/src/commands/getJSON.js +2 -2
- package/lib/src/commands/getJSON.js.map +1 -1
- package/lib/src/commands/getNumElements.js +4 -4
- package/lib/src/commands/getNumElements.js.map +1 -1
- package/lib/src/commands/getProfileValue.js +1 -1
- package/lib/src/commands/getProfileValue.js.map +1 -1
- package/lib/src/commands/getSpecialChars.js +2 -2
- package/lib/src/commands/getSpecialChars.js.map +1 -1
- package/lib/src/commands/getTitle.js +3 -3
- package/lib/src/commands/getTitle.js.map +1 -1
- package/lib/src/commands/handleHarvardKey.js +12 -12
- package/lib/src/commands/handleHarvardKey.js.map +1 -1
- package/lib/src/commands/helpers/getFormData.js +13 -13
- package/lib/src/commands/helpers/getFormData.js.map +1 -1
- package/lib/src/commands/index.js +34 -34
- package/lib/src/commands/index.js.map +1 -1
- package/lib/src/commands/launchAs.js +25 -26
- package/lib/src/commands/launchAs.js.map +1 -1
- package/lib/src/commands/listSelectLabels.js +6 -6
- package/lib/src/commands/listSelectLabels.js.map +1 -1
- package/lib/src/commands/listSelectValues.js +7 -7
- package/lib/src/commands/listSelectValues.js.map +1 -1
- package/lib/src/commands/logIntoPorta.js +21 -31
- package/lib/src/commands/logIntoPorta.js.map +1 -1
- package/lib/src/commands/navigateToHref.js +7 -7
- package/lib/src/commands/navigateToHref.js.map +1 -1
- package/lib/src/commands/padWithZeros.js +6 -6
- package/lib/src/commands/padWithZeros.js.map +1 -1
- package/lib/src/commands/runScript.js +4 -4
- package/lib/src/commands/runScript.js.map +1 -1
- package/lib/src/commands/tap.js +2 -2
- package/lib/src/commands/tap.js.map +1 -1
- package/lib/src/commands/tapInIFrame.js +2 -2
- package/lib/src/commands/tapInIFrame.js.map +1 -1
- package/lib/src/commands/typeInto.js +9 -9
- package/lib/src/commands/typeInto.js.map +1 -1
- package/lib/src/commands/uniquify.js +7 -7
- package/lib/src/commands/uniquify.js.map +1 -1
- package/lib/src/commands/visitCanvasEndpoint.js +7 -18
- package/lib/src/commands/visitCanvasEndpoint.js.map +1 -1
- package/lib/src/commands/waitForAtLeastOneElementPresent.js +9 -9
- package/lib/src/commands/waitForAtLeastOneElementPresent.js.map +1 -1
- package/lib/src/commands/waitForElementVisible.js +4 -4
- package/lib/src/commands/waitForElementVisible.js.map +1 -1
- package/lib/src/genConfiguration/helpers/getRootPath.js +3 -3
- package/lib/src/genConfiguration/helpers/getRootPath.js.map +1 -1
- package/lib/src/genConfiguration/helpers/resolveDependents.js +8 -9
- package/lib/src/genConfiguration/helpers/resolveDependents.js.map +1 -1
- package/lib/src/genConfiguration/helpers/splitEnv.js +5 -6
- package/lib/src/genConfiguration/helpers/splitEnv.js.map +1 -1
- package/lib/src/genConfiguration/index.js +36 -44
- package/lib/src/genConfiguration/index.js.map +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/start/constants/AVAILABLE_BROWSERS.js +1 -1
- package/lib/start/constants/AVAILABLE_BROWSERS.js.map +1 -1
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js +1 -1
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js.map +1 -1
- package/lib/start/helpers/collectPngFiles.js +8 -9
- package/lib/start/helpers/collectPngFiles.js.map +1 -1
- package/lib/start/helpers/exec.js +2 -2
- package/lib/start/helpers/exec.js.map +1 -1
- package/lib/start/helpers/executeAllHeadlessCombinations.js +58 -89
- package/lib/start/helpers/executeAllHeadlessCombinations.js.map +1 -1
- package/lib/start/helpers/executeCypress.js +32 -73
- package/lib/start/helpers/executeCypress.js.map +1 -1
- package/lib/start/helpers/extractArgValue.js +7 -7
- package/lib/start/helpers/extractArgValue.js.map +1 -1
- package/lib/start/helpers/findProfilesByNames.js +7 -7
- package/lib/start/helpers/findProfilesByNames.js.map +1 -1
- package/lib/start/helpers/generateHtmlReport.js +19 -19
- package/lib/start/helpers/generateHtmlReport.js.map +1 -1
- package/lib/start/helpers/generateReportHomepage.js +49 -68
- package/lib/start/helpers/generateReportHomepage.js.map +1 -1
- package/lib/start/helpers/generateReporterConfig.js +4 -4
- package/lib/start/helpers/generateReporterConfig.js.map +1 -1
- package/lib/start/helpers/getDateLabeledDir.js +17 -17
- package/lib/start/helpers/getDateLabeledDir.js.map +1 -1
- package/lib/start/helpers/getRootPath.js +3 -3
- package/lib/start/helpers/getRootPath.js.map +1 -1
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js +29 -29
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js.map +1 -1
- package/lib/start/helpers/mergeReports.js +22 -22
- package/lib/start/helpers/mergeReports.js.map +1 -1
- package/lib/start/helpers/parseCommaSeparated.js +3 -3
- package/lib/start/helpers/parseCommaSeparated.js.map +1 -1
- package/lib/start/helpers/print.js +19 -19
- package/lib/start/helpers/print.js.map +1 -1
- package/lib/start/helpers/prompt.js +5 -5
- package/lib/start/helpers/prompt.js.map +1 -1
- package/lib/start/helpers/runCypressHeadless.js +41 -52
- package/lib/start/helpers/runCypressHeadless.js.map +1 -1
- package/lib/start/helpers/runCypressVisible.js +13 -24
- package/lib/start/helpers/runCypressVisible.js.map +1 -1
- package/lib/start/helpers/showChooser.js +27 -38
- package/lib/start/helpers/showChooser.js.map +1 -1
- package/lib/start/helpers/validateBrowsers.js +8 -8
- package/lib/start/helpers/validateBrowsers.js.map +1 -1
- package/lib/start/index.js +58 -60
- package/lib/start/index.js.map +1 -1
- package/package.json +5 -2
- package/setup/checkRequiredFiles/genEmptyProfileFile.ts +15 -1
- package/setup/genTsConfigFile.ts +1 -0
- package/src/genConfiguration/index.ts +3 -1
- package/tsconfig.json +5 -3
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -17,94 +6,97 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
6
|
/* eslint-disable no-console */
|
|
18
7
|
/* eslint-disable global-require */
|
|
19
8
|
/* eslint-disable import/no-dynamic-require */
|
|
20
|
-
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
21
10
|
// Import cypress
|
|
22
|
-
|
|
11
|
+
const cypress_1 = require("cypress");
|
|
23
12
|
// Import external libraries
|
|
24
|
-
|
|
13
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
25
14
|
// Import helpers
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
const splitEnv_1 = __importDefault(require("./helpers/splitEnv"));
|
|
16
|
+
const resolveDependents_1 = __importDefault(require("./helpers/resolveDependents"));
|
|
17
|
+
const getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
29
18
|
// Determine project directory
|
|
30
|
-
|
|
19
|
+
const CWD = (0, getRootPath_1.default)();
|
|
31
20
|
/**
|
|
32
21
|
* Generate Cypress configuration based on global credentials,
|
|
33
22
|
* variables, resources, and profiles
|
|
34
23
|
* @author Gardenia Liu
|
|
35
24
|
* @author Gabe Abrams
|
|
36
25
|
*/
|
|
37
|
-
|
|
26
|
+
const genConfiguration = () => {
|
|
38
27
|
var _a, _b, _c, _d;
|
|
39
28
|
// Define paths
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
const GLOBALS_PATH = path_1.default.join(CWD, '/cypress/globals');
|
|
30
|
+
const PROFILES_PATH = path_1.default.join(CWD, '/cypress/profiles');
|
|
42
31
|
// Import global env var objects
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
const GlobalCredentials = require(path_1.default.join(GLOBALS_PATH, '/GlobalCredentials')).default;
|
|
33
|
+
const GlobalResources = require(path_1.default.join(GLOBALS_PATH, '/GlobalResources')).default;
|
|
34
|
+
const GlobalValues = require(path_1.default.join(GLOBALS_PATH, '/GlobalValues')).default;
|
|
46
35
|
// Determine profile file name (default is stage)
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
const profileName = process.env.CYPRESS_PROFILE || 'Stage';
|
|
37
|
+
const defaultProfileName = 'Default';
|
|
49
38
|
// Load in chosen profile configuration
|
|
50
|
-
|
|
39
|
+
let profileModules = {};
|
|
51
40
|
try {
|
|
52
41
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
53
|
-
|
|
42
|
+
const mod = require(path_1.default.join(PROFILES_PATH, `/${profileName}.Profile`));
|
|
54
43
|
profileModules = ((_b = (_a = mod === null || mod === void 0 ? void 0 : mod.default) !== null && _a !== void 0 ? _a : mod) !== null && _b !== void 0 ? _b : {});
|
|
55
44
|
}
|
|
56
45
|
catch (e) {
|
|
57
|
-
console.warn(
|
|
46
|
+
console.warn(`[cypress.config] Could not load profile '${profileName}.Profile'`, e);
|
|
58
47
|
process.exit(1);
|
|
59
48
|
}
|
|
60
49
|
// Load default profile configuration
|
|
61
|
-
|
|
50
|
+
let defaultProfileModules = {};
|
|
62
51
|
try {
|
|
63
52
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
64
|
-
|
|
53
|
+
const mod = require(path_1.default.join(PROFILES_PATH, `/${defaultProfileName}.Profile`));
|
|
65
54
|
defaultProfileModules = ((_d = (_c = mod === null || mod === void 0 ? void 0 : mod.default) !== null && _c !== void 0 ? _c : mod) !== null && _d !== void 0 ? _d : {});
|
|
66
55
|
}
|
|
67
56
|
catch (e) {
|
|
68
|
-
console.warn(
|
|
57
|
+
console.warn(`[cypress.config] Could not load profile '${defaultProfileName}.Profile'`, e);
|
|
69
58
|
process.exit(1);
|
|
70
59
|
}
|
|
71
60
|
// NOTE: Order matters (later overrides earlier)
|
|
72
|
-
|
|
61
|
+
const sources = [
|
|
73
62
|
GlobalResources,
|
|
74
63
|
GlobalValues,
|
|
75
64
|
profileModules,
|
|
76
65
|
defaultProfileModules,
|
|
77
66
|
];
|
|
78
67
|
// Split all sources into basic and dependent
|
|
79
|
-
|
|
68
|
+
const splits = sources.map((source) => {
|
|
80
69
|
return (0, splitEnv_1.default)(source);
|
|
81
70
|
});
|
|
82
71
|
// Extract basic and dependent values from splits
|
|
83
|
-
|
|
72
|
+
const basicValues = splits.map((s) => {
|
|
84
73
|
return s.basic;
|
|
85
74
|
});
|
|
86
|
-
|
|
75
|
+
const dependentValues = splits.map((s) => {
|
|
87
76
|
return s.dependent;
|
|
88
77
|
});
|
|
89
78
|
// Merge all of the basics
|
|
90
|
-
|
|
79
|
+
const basics = deepmerge_1.default.all(basicValues);
|
|
91
80
|
// Resolve dependencies
|
|
92
|
-
|
|
81
|
+
const dependents = (0, resolveDependents_1.default)(dependentValues, basics);
|
|
93
82
|
// Add basics, depends, and profileName into the final env
|
|
94
|
-
|
|
83
|
+
const exposed = Object.assign(Object.assign(Object.assign({}, basics), dependents), { profileName });
|
|
95
84
|
// Add all global values and credentials into the final env
|
|
96
85
|
// Does not support dependent values in GlobalCredentials, TODO: Fix
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (!
|
|
100
|
-
|
|
86
|
+
const securedEnv = Object.assign(Object.assign({}, GlobalCredentials), exposed);
|
|
87
|
+
let baseUrl = exposed.baseURL;
|
|
88
|
+
if (!baseUrl) {
|
|
89
|
+
throw new Error('Could not find baseURL in the environment variables');
|
|
90
|
+
}
|
|
91
|
+
else if (!baseUrl.startsWith('http')) {
|
|
92
|
+
baseUrl = `https://${baseUrl}`;
|
|
101
93
|
}
|
|
102
94
|
// Return the configuration object
|
|
103
95
|
return (0, cypress_1.defineConfig)({
|
|
104
96
|
e2e: {
|
|
105
97
|
experimentalWebKitSupport: true,
|
|
106
98
|
experimentalOriginDependencies: true,
|
|
107
|
-
baseUrl
|
|
99
|
+
baseUrl,
|
|
108
100
|
expose: exposed,
|
|
109
101
|
env: securedEnv,
|
|
110
102
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/genConfiguration/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/genConfiguration/index.ts"],"names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AAS,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,0BAA0B;IAC1B,MAAM,MAAM,GAAqB,mBAAS,CAAC,GAAG,CAAmB,WAAW,CAAC,CAAC;IAE9E,uBAAuB;IACvB,MAAM,UAAU,GAAqB,IAAA,2BAAiB,EAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAEhF,0DAA0D;IAC1D,MAAM,OAAO,iDACR,MAAM,GACN,UAAU,KACb,WAAW,GACZ,CAAC;IAEF,2DAA2D;IAC3D,oEAAoE;IACpE,MAAM,UAAU,mCACX,iBAAiB,GACjB,OAAO,CACX,CAAC;IAEF,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAC9B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;SAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,OAAO,GAAG,WAAW,OAAO,EAAE,CAAC;IACjC,CAAC;IAED,kCAAkC;IAClC,OAAO,IAAA,sBAAY,EAAC;QAClB,GAAG,EAAE;YACH,yBAAyB,EAAE,IAAI;YAC/B,8BAA8B,EAAE,IAAI;YACpC,OAAO;YACP,MAAM,EAAE,OAAO;YACf,GAAG,EAAE,UAAU;SAChB;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|
package/lib/src/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
// Import helpers
|
|
7
|
-
|
|
7
|
+
const commands_1 = __importDefault(require("./commands"));
|
|
8
8
|
// Initialize commands
|
|
9
9
|
(0, commands_1.default)();
|
|
10
10
|
exports.default = commands_1.default;
|
package/lib/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AAAA,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AAAA,iBAAiB;AACjB,0DAAkC;AAElC,sBAAsB;AACtB,IAAA,kBAAQ,GAAE,CAAC;AAEX,kBAAe,kBAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AVAILABLE_BROWSERS.js","sourceRoot":"","sources":["../../../start/constants/AVAILABLE_BROWSERS.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"AVAILABLE_BROWSERS.js","sourceRoot":"","sources":["../../../start/constants/AVAILABLE_BROWSERS.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,MAAM,kBAAkB,GAGlB;IACJ;QACE,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,GAAG;KACT;IACD;QACE,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,GAAG;KACT;IACD;QACE,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,GAAG;KACT;IACD;QACE,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,GAAG;KACT;CACF,CAAC;AAEF,6CAA6C;AAC7C,kBAAe,kBAAkB,CAAC"}
|
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
* Default number of threads per combo
|
|
5
5
|
* @author Yuen Ler Chow
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
const DEFAULT_THREADS_PER_COMBO = 2;
|
|
8
8
|
exports.default = DEFAULT_THREADS_PER_COMBO;
|
|
9
9
|
//# sourceMappingURL=DEFAULT_THREADS_PER_COMBO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DEFAULT_THREADS_PER_COMBO.js","sourceRoot":"","sources":["../../../start/constants/DEFAULT_THREADS_PER_COMBO.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"DEFAULT_THREADS_PER_COMBO.js","sourceRoot":"","sources":["../../../start/constants/DEFAULT_THREADS_PER_COMBO.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC,kBAAe,yBAAyB,CAAC"}
|
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
8
|
/**
|
|
9
9
|
* Collect all PNG files recursively from a directory
|
|
10
10
|
* @author Yuen Ler Chow
|
|
@@ -12,14 +12,13 @@ var path_1 = __importDefault(require("path"));
|
|
|
12
12
|
* @param prefix - Path prefix for relative paths
|
|
13
13
|
* @returns Array of relative file paths
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var fullPath = path_1.default.join(dir, entry.name);
|
|
15
|
+
const collectPngFiles = (dir, prefix = '') => {
|
|
16
|
+
const files = [];
|
|
17
|
+
const dirEntries = fs_1.default.readdirSync(dir, { withFileTypes: true });
|
|
18
|
+
dirEntries.forEach((entry) => {
|
|
19
|
+
const fullPath = path_1.default.join(dir, entry.name);
|
|
21
20
|
if (entry.isDirectory()) {
|
|
22
|
-
files.push
|
|
21
|
+
files.push(...collectPngFiles(fullPath, path_1.default.join(prefix, entry.name)));
|
|
23
22
|
}
|
|
24
23
|
else if (entry.isFile() && entry.name.toLowerCase().endsWith('.png')) {
|
|
25
24
|
files.push(path_1.default.join(prefix, entry.name));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectPngFiles.js","sourceRoot":"","sources":["../../../start/helpers/collectPngFiles.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"collectPngFiles.js","sourceRoot":"","sources":["../../../start/helpers/collectPngFiles.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,MAAM,GAAG,EAAE,EAAY,EAAE;IAC7D,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,UAAU,GAAG,YAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,QAAQ,EAAE,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvE,KAAK,CAAC,IAAI,CAAC,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const child_process_1 = require("child_process");
|
|
4
4
|
/**
|
|
5
5
|
* Execute a command
|
|
6
6
|
* @author Gabe Abrams
|
|
7
7
|
* @param command the command to execute
|
|
8
8
|
* @param printToStdOut if true, print to standard out instead of returning
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const exec = (command, printToStdOut) => {
|
|
11
11
|
if (printToStdOut) {
|
|
12
12
|
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
13
13
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../start/helpers/exec.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../start/helpers/exec.ts"],"names":[],"mappings":";;AAAA,iDAAyC;AAEzC;;;;;GAKG;AACH,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,aAAuB,EAAU,EAAE;IAChE,IAAI,aAAa,EAAE,CAAC;QAClB,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACxC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,IAAA,wBAAQ,EAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -8,45 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
13
|
};
|
|
41
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
15
|
/* eslint-disable no-console */
|
|
43
|
-
|
|
44
|
-
|
|
16
|
+
const fs_1 = __importDefault(require("fs"));
|
|
17
|
+
const path_1 = __importDefault(require("path"));
|
|
45
18
|
// Import helpers
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
19
|
+
const runCypressHeadless_1 = __importDefault(require("./runCypressHeadless"));
|
|
20
|
+
const getDateLabeledDir_1 = __importDefault(require("./getDateLabeledDir"));
|
|
21
|
+
const generateReportHomepage_1 = __importDefault(require("./generateReportHomepage"));
|
|
22
|
+
const mergeAllReportsAndGenerateHtml_1 = __importDefault(require("./mergeAllReportsAndGenerateHtml"));
|
|
50
23
|
/**
|
|
51
24
|
* Execute all headless Cypress test combinations in parallel
|
|
52
25
|
* @author Yuen Ler Chow
|
|
@@ -55,62 +28,58 @@ var mergeAllReportsAndGenerateHtml_1 = __importDefault(require("./mergeAllReport
|
|
|
55
28
|
* @param opts.selectedBrowsers - Array of selected browsers
|
|
56
29
|
* @param [opts.threadsPerCombo] - Number of parallel threads per combo (default: 2)
|
|
57
30
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
timestamp: new Date().toLocaleString(),
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
(0, generateReportHomepage_1.default)(reportInfos, outputDir);
|
|
102
|
-
passed = results.filter(function (r) { return r.success; }).length;
|
|
103
|
-
failed = results.filter(function (r) { return !r.success; }).length;
|
|
104
|
-
console.log('\n═══════════════════════════════════════════════════════════');
|
|
105
|
-
console.log('📊 Execution Summary:');
|
|
106
|
-
console.log(" Total: ".concat(results.length));
|
|
107
|
-
console.log(" \u2705 Passed: ".concat(passed));
|
|
108
|
-
console.log(" \u274C Failed: ".concat(failed));
|
|
109
|
-
console.log(" \uD83D\uDCC4 Report homepage: file://".concat(path_1.default.join(outputDir, 'index.html')));
|
|
110
|
-
console.log('═══════════════════════════════════════════════════════════\n');
|
|
111
|
-
return [2 /*return*/];
|
|
112
|
-
}
|
|
31
|
+
const executeAllHeadlessCombinations = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
const { selectedProfiles, selectedBrowsers, threadsPerCombo } = opts;
|
|
33
|
+
// Create date-labeled output directory
|
|
34
|
+
const outputDir = (0, getDateLabeledDir_1.default)();
|
|
35
|
+
if (!fs_1.default.existsSync(outputDir)) {
|
|
36
|
+
fs_1.default.mkdirSync(outputDir, { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
console.log(`📁 Results will be saved to: ${outputDir}\n`);
|
|
39
|
+
// Generate all Profile+Browser combinations
|
|
40
|
+
const combinations = [];
|
|
41
|
+
selectedProfiles.forEach((profile) => {
|
|
42
|
+
selectedBrowsers.forEach((browser) => {
|
|
43
|
+
combinations.push({
|
|
44
|
+
profileName: profile.profileName,
|
|
45
|
+
browser,
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
console.log(`🔄 Running ${combinations.length} test combination(s) in parallel...\n`);
|
|
50
|
+
// Run all combinations in parallel
|
|
51
|
+
const runPromises = combinations.map((combo) => {
|
|
52
|
+
return (0, runCypressHeadless_1.default)({
|
|
53
|
+
profileName: combo.profileName,
|
|
54
|
+
browser: combo.browser,
|
|
55
|
+
outputDir,
|
|
56
|
+
numThreads: threadsPerCombo,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
const results = yield Promise.all(runPromises);
|
|
60
|
+
// Generate combined HTML report across all profile+browser combinations
|
|
61
|
+
(0, mergeAllReportsAndGenerateHtml_1.default)(outputDir, results);
|
|
62
|
+
// Generate report homepage
|
|
63
|
+
const reportInfos = results.map((result) => {
|
|
64
|
+
return {
|
|
65
|
+
profileName: result.profileName,
|
|
66
|
+
browser: result.browser,
|
|
67
|
+
reportPath: result.reportPath || '',
|
|
68
|
+
success: result.success,
|
|
69
|
+
timestamp: new Date().toLocaleString(),
|
|
70
|
+
};
|
|
113
71
|
});
|
|
114
|
-
|
|
72
|
+
(0, generateReportHomepage_1.default)(reportInfos, outputDir);
|
|
73
|
+
// Print summary
|
|
74
|
+
const passed = results.filter((r) => { return r.success; }).length;
|
|
75
|
+
const failed = results.filter((r) => { return !r.success; }).length;
|
|
76
|
+
console.log('\n═══════════════════════════════════════════════════════════');
|
|
77
|
+
console.log('📊 Execution Summary:');
|
|
78
|
+
console.log(` Total: ${results.length}`);
|
|
79
|
+
console.log(` ✅ Passed: ${passed}`);
|
|
80
|
+
console.log(` ❌ Failed: ${failed}`);
|
|
81
|
+
console.log(` 📄 Report homepage: file://${path_1.default.join(outputDir, 'index.html')}`);
|
|
82
|
+
console.log('═══════════════════════════════════════════════════════════\n');
|
|
83
|
+
});
|
|
115
84
|
exports.default = executeAllHeadlessCombinations;
|
|
116
85
|
//# sourceMappingURL=executeAllHeadlessCombinations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeAllHeadlessCombinations.js","sourceRoot":"","sources":["../../../start/helpers/executeAllHeadlessCombinations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executeAllHeadlessCombinations.js","sourceRoot":"","sources":["../../../start/helpers/executeAllHeadlessCombinations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AAExB,iBAAiB;AACjB,8EAAsD;AACtD,4EAAoD;AACpD,sFAA8D;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BAA8B,CAAC"}
|
|
@@ -9,42 +9,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
14
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
-
function step(op) {
|
|
17
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
19
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
-
switch (op[0]) {
|
|
22
|
-
case 0: case 1: t = op; break;
|
|
23
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
-
default:
|
|
27
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
-
if (t[2]) _.ops.pop();
|
|
32
|
-
_.trys.pop(); continue;
|
|
33
|
-
}
|
|
34
|
-
op = body.call(thisArg, _);
|
|
35
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
12
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
14
|
};
|
|
42
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
16
|
// Import helpers
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
const runCypressVisible_1 = __importDefault(require("./runCypressVisible"));
|
|
18
|
+
const executeAllHeadlessCombinations_1 = __importDefault(require("./executeAllHeadlessCombinations"));
|
|
46
19
|
// Import constants
|
|
47
|
-
|
|
20
|
+
const DEFAULT_THREADS_PER_COMBO_1 = __importDefault(require("../constants/DEFAULT_THREADS_PER_COMBO"));
|
|
48
21
|
/**
|
|
49
22
|
* Execute Cypress tests in either headless or visible mode
|
|
50
23
|
* @author Yuen Ler Chow
|
|
@@ -54,50 +27,36 @@ var DEFAULT_THREADS_PER_COMBO_1 = __importDefault(require("../constants/DEFAULT_
|
|
|
54
27
|
* @param opts.isHeadless - Whether to run in headless mode
|
|
55
28
|
* @param [opts.threadsPerCombo] - Number of parallel threads per combo (default: 2)
|
|
56
29
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!!isHeadless) return [3 /*break*/, 3];
|
|
76
|
-
profileName = selectedProfiles[0].profileName;
|
|
77
|
-
return [4 /*yield*/, (0, runCypressVisible_1.default)(profileName)];
|
|
78
|
-
case 2:
|
|
79
|
-
_a.sent();
|
|
80
|
-
return [3 /*break*/, 5];
|
|
81
|
-
case 3:
|
|
30
|
+
const executeCypress = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const { selectedProfiles, selectedBrowsers, isHeadless, threadsPerCombo, } = opts;
|
|
32
|
+
console.log('\n═══════════════════════════════════════════════════════════');
|
|
33
|
+
console.log('Starting Cypress with the following configuration:');
|
|
34
|
+
console.log(`Profile(s): ${selectedProfiles.map((p) => { return p.profileName; }).join(', ')}`);
|
|
35
|
+
console.log(`Browser(s): ${selectedBrowsers.join(', ')}`);
|
|
36
|
+
console.log(`Headless: ${isHeadless}`);
|
|
37
|
+
if (isHeadless) {
|
|
38
|
+
console.log(`Threads per combo: ${threadsPerCombo !== null && threadsPerCombo !== void 0 ? threadsPerCombo : DEFAULT_THREADS_PER_COMBO_1.default}`);
|
|
39
|
+
}
|
|
40
|
+
console.log('═══════════════════════════════════════════════════════════\n');
|
|
41
|
+
try {
|
|
42
|
+
if (!isHeadless) {
|
|
43
|
+
// Visible mode: run with single profile
|
|
44
|
+
const { profileName } = selectedProfiles[0];
|
|
45
|
+
yield (0, runCypressVisible_1.default)(profileName);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
82
48
|
// Headless mode: run parallel instances for each Profile+Browser combination
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
case 4:
|
|
89
|
-
// Headless mode: run parallel instances for each Profile+Browser combination
|
|
90
|
-
_a.sent();
|
|
91
|
-
_a.label = 5;
|
|
92
|
-
case 5: return [3 /*break*/, 7];
|
|
93
|
-
case 6:
|
|
94
|
-
error_1 = _a.sent();
|
|
95
|
-
console.error('\n❌ Error during execution:', error_1);
|
|
96
|
-
process.exit(1);
|
|
97
|
-
return [3 /*break*/, 7];
|
|
98
|
-
case 7: return [2 /*return*/];
|
|
49
|
+
yield (0, executeAllHeadlessCombinations_1.default)({
|
|
50
|
+
selectedProfiles,
|
|
51
|
+
selectedBrowsers,
|
|
52
|
+
threadsPerCombo,
|
|
53
|
+
});
|
|
99
54
|
}
|
|
100
|
-
}
|
|
101
|
-
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.error('\n❌ Error during execution:', error);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
102
61
|
exports.default = executeCypress;
|
|
103
62
|
//# sourceMappingURL=executeCypress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeCypress.js","sourceRoot":"","sources":["../../../start/helpers/executeCypress.ts"],"names":[],"mappings":";AAAA,+BAA+B
|
|
1
|
+
{"version":3,"file":"executeCypress.js","sourceRoot":"","sources":["../../../start/helpers/executeCypress.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;;;;;;;;;;;;AAK/B,iBAAiB;AACjB,4EAAoD;AACpD,sGAA8E;AAE9E,mBAAmB;AACnB,uGAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,CACrB,IAKC,EACc,EAAE;IACjB,MAAM,EACJ,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,eAAe,GAChB,GAAG,IAAI,CAAC;IAET,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,eAAe,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,eAAe,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,aAAa,UAAU,EAAE,CAAC,CAAC;IACvC,IA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