dceky 1.1.1 → 1.1.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/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 +12 -12
- 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 +8 -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/src/genConfiguration/index.ts +3 -1
- package/tsconfig.json +4 -3
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
// Import libs
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
11
|
// Import helpers
|
|
12
|
-
|
|
12
|
+
const getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
13
13
|
/**
|
|
14
14
|
* Recursively annotate mochawesome suites (not individual tests) with a label
|
|
15
15
|
* so the combined report shows profile+browser for each suite
|
|
@@ -17,32 +17,32 @@ var getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
|
17
17
|
* @param node - The mochawesome node to annotate
|
|
18
18
|
* @param label - The label to prepend to suite titles
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
const annotateMochawesomeSuites = (node, label) => {
|
|
21
21
|
if (!node || typeof node !== 'object') {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
// If this is an array of nodes, annotate each element
|
|
25
25
|
if (Array.isArray(node)) {
|
|
26
|
-
node.forEach(
|
|
26
|
+
node.forEach((child) => {
|
|
27
27
|
annotateMochawesomeSuites(child, label);
|
|
28
28
|
});
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
// Only annotate if this is a suite (has suites or tests arrays)
|
|
32
|
-
|
|
32
|
+
const isSuite = Array.isArray(node.suites) || Array.isArray(node.tests);
|
|
33
33
|
if (isSuite) {
|
|
34
34
|
if (typeof node.title === 'string') {
|
|
35
35
|
// eslint-disable-next-line no-param-reassign
|
|
36
|
-
node.title =
|
|
36
|
+
node.title = `${label}${node.title}`;
|
|
37
37
|
}
|
|
38
38
|
if (typeof node.fullTitle === 'string') {
|
|
39
39
|
// eslint-disable-next-line no-param-reassign
|
|
40
|
-
node.fullTitle =
|
|
40
|
+
node.fullTitle = `${label}${node.fullTitle}`;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
// Recurse into child suites (but not tests)
|
|
44
44
|
if (Array.isArray(node.suites)) {
|
|
45
|
-
node.suites.forEach(
|
|
45
|
+
node.suites.forEach((suite) => {
|
|
46
46
|
annotateMochawesomeSuites(suite, label);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -55,49 +55,49 @@ var annotateMochawesomeSuites = function (node, label) {
|
|
|
55
55
|
* @param outputDir - Date-labeled results directory
|
|
56
56
|
* @param results - Array of run results
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
const mergeAllReportsAndGenerateHtml = (outputDir, results) => {
|
|
59
59
|
// Collect annotated copies of report-data.json files from successful runs
|
|
60
|
-
|
|
61
|
-
results.forEach(
|
|
62
|
-
|
|
60
|
+
const annotatedJsonPaths = [];
|
|
61
|
+
results.forEach((result) => {
|
|
62
|
+
const jsonPath = path_1.default.join(outputDir, `${result.profileName}-${result.browser}`, 'report-data.json');
|
|
63
63
|
if (!fs_1.default.existsSync(jsonPath)) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
try {
|
|
67
67
|
// Import the json report
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
const raw = fs_1.default.readFileSync(jsonPath, 'utf-8');
|
|
69
|
+
const data = JSON.parse(raw);
|
|
70
|
+
const label = `[${result.profileName}][${result.browser}] `;
|
|
71
71
|
if (Array.isArray(data.results)) {
|
|
72
|
-
data.results.forEach(
|
|
72
|
+
data.results.forEach((res) => {
|
|
73
73
|
if (res && res.suites) {
|
|
74
|
-
annotateMochawesomeSuites(res.suites,
|
|
74
|
+
annotateMochawesomeSuites(res.suites, label);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
// Annotate tests with their profile+browser
|
|
79
|
-
|
|
79
|
+
const annotatedPath = path_1.default.join(outputDir, `${result.profileName}-${result.browser}-labeled.json`);
|
|
80
80
|
fs_1.default.writeFileSync(annotatedPath, JSON.stringify(data, null, 2), 'utf-8');
|
|
81
81
|
annotatedJsonPaths.push(annotatedPath);
|
|
82
82
|
}
|
|
83
83
|
catch (e) {
|
|
84
|
-
console.error(
|
|
84
|
+
console.error(`Error annotating report for ${result.profileName} + ${result.browser}:`, e);
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
if (annotatedJsonPaths.length === 0) {
|
|
88
88
|
console.warn('No annotated report-data.json files found. Skipping global merge.');
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
const allReportDataPath = path_1.default.join(outputDir, 'all-report-data.json');
|
|
92
|
+
const allReportHtmlDir = outputDir;
|
|
93
93
|
try {
|
|
94
94
|
// Build mochawesome-merge command with all annotated JSON paths
|
|
95
|
-
|
|
96
|
-
.map(
|
|
97
|
-
return "
|
|
95
|
+
const mergedArgs = (annotatedJsonPaths
|
|
96
|
+
.map((p) => {
|
|
97
|
+
return `"${p}"`;
|
|
98
98
|
})
|
|
99
99
|
.join(' '));
|
|
100
|
-
|
|
100
|
+
const mergeCommand = `npx mochawesome-merge ${mergedArgs} > "${allReportDataPath}"`;
|
|
101
101
|
console.log('Merging all annotated report-data.json files into a single JSON for all runs...');
|
|
102
102
|
(0, child_process_1.execSync)(mergeCommand, {
|
|
103
103
|
stdio: 'inherit',
|
|
@@ -105,13 +105,13 @@ var mergeAllReportsAndGenerateHtml = function (outputDir, results) {
|
|
|
105
105
|
shell: '/bin/bash',
|
|
106
106
|
});
|
|
107
107
|
// Generate combined HTML using marge
|
|
108
|
-
|
|
108
|
+
const margeCommand = `npx marge "${allReportDataPath}" --reportDir "${allReportHtmlDir}" --reportFilename "all-runs"`;
|
|
109
109
|
console.log('Generating combined HTML report for all runs...');
|
|
110
110
|
(0, child_process_1.execSync)(margeCommand, {
|
|
111
111
|
stdio: 'inherit',
|
|
112
112
|
cwd: (0, getRootPath_1.default)(),
|
|
113
113
|
});
|
|
114
|
-
console.log(
|
|
114
|
+
console.log(`Combined HTML report generated at: ${path_1.default.join(allReportHtmlDir, 'all-runs.html')}`);
|
|
115
115
|
}
|
|
116
116
|
catch (e) {
|
|
117
117
|
console.error('Error generating combined HTML report for all runs:', e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeAllReportsAndGenerateHtml.js","sourceRoot":"","sources":["../../../start/helpers/mergeAllReportsAndGenerateHtml.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;;;AAE/B,cAAc;AACd
|
|
1
|
+
{"version":3,"file":"mergeAllReportsAndGenerateHtml.js","sourceRoot":"","sources":["../../../start/helpers/mergeAllReportsAndGenerateHtml.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;;;AAE/B,cAAc;AACd,iDAAyC;AACzC,4CAAoB;AACpB,gDAAwB;AAExB,iBAAiB;AACjB,gEAAwC;AAGxC;;;;;;GAMG;AACH,MAAM,yBAAyB,GA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C,CAAC;IACpG,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,qDAAqD,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,8BAA8B,CAAC"}
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
/* eslint-disable no-console */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
11
11
|
/**
|
|
12
12
|
* Merge mochawesome JSON reports into a single JSON file using mochawesome-merge
|
|
13
13
|
* @author Yuen Ler Chow
|
|
@@ -16,31 +16,31 @@ var getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
|
16
16
|
* @param opts.profileName - Profile name
|
|
17
17
|
* @param opts.browserName - Browser name
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
console.log(
|
|
24
|
-
console.log(
|
|
25
|
-
console.log(
|
|
19
|
+
const mergeReports = (opts) => {
|
|
20
|
+
const { resultsDir, profileName, browserName } = opts;
|
|
21
|
+
const granularResultsDir = path_1.default.join(resultsDir, `${profileName}-${browserName}`, 'granular-results');
|
|
22
|
+
const reportDataPath = path_1.default.join(resultsDir, `${profileName}-${browserName}`, 'report-data.json');
|
|
23
|
+
console.log(`\n📊 Merge Reports Debug for ${profileName} + ${browserName}:`);
|
|
24
|
+
console.log(` Granular results dir: ${granularResultsDir}`);
|
|
25
|
+
console.log(` Report data path: ${reportDataPath}`);
|
|
26
26
|
if (!(0, fs_1.existsSync)(granularResultsDir)) {
|
|
27
|
-
|
|
27
|
+
const errorMsg = `❌ ERROR: Granular results directory does not exist: ${granularResultsDir}`;
|
|
28
28
|
console.error(errorMsg);
|
|
29
29
|
throw new Error(errorMsg);
|
|
30
30
|
}
|
|
31
31
|
// List files in granular results directory
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
console.log(
|
|
32
|
+
const files = (0, fs_1.readdirSync)(granularResultsDir);
|
|
33
|
+
const jsonFiles = files.filter((f) => { return f.endsWith('.json'); });
|
|
34
|
+
console.log(` Found ${jsonFiles.length} JSON files: ${jsonFiles.join(', ') || '(none)'}`);
|
|
35
35
|
if (jsonFiles.length === 0) {
|
|
36
|
-
|
|
36
|
+
const errorMsg = `❌ ERROR: No JSON files found in granular results directory: ${granularResultsDir}`;
|
|
37
37
|
console.error(errorMsg);
|
|
38
38
|
throw new Error(errorMsg);
|
|
39
39
|
}
|
|
40
40
|
try {
|
|
41
|
-
|
|
42
|
-
console.log(
|
|
43
|
-
console.log(
|
|
41
|
+
const command = `npx mochawesome-merge "${path_1.default.join(granularResultsDir, '*.json')}" > "${reportDataPath}"`;
|
|
42
|
+
console.log(` Running: ${command}`);
|
|
43
|
+
console.log(`Merging reports for ${profileName} + ${browserName}...`);
|
|
44
44
|
(0, child_process_1.execSync)(command, {
|
|
45
45
|
stdio: 'inherit',
|
|
46
46
|
cwd: (0, getRootPath_1.default)(),
|
|
@@ -48,14 +48,14 @@ var mergeReports = function (opts) {
|
|
|
48
48
|
});
|
|
49
49
|
// Verify the report was created
|
|
50
50
|
if (!(0, fs_1.existsSync)(reportDataPath)) {
|
|
51
|
-
|
|
51
|
+
const errorMsg = `❌ ERROR: Report data was not created at: ${reportDataPath}`;
|
|
52
52
|
console.error(errorMsg);
|
|
53
53
|
throw new Error(errorMsg);
|
|
54
54
|
}
|
|
55
|
-
console.log(
|
|
55
|
+
console.log(` ✅ Report data created successfully at: ${reportDataPath}`);
|
|
56
56
|
}
|
|
57
57
|
catch (e) {
|
|
58
|
-
console.error(
|
|
58
|
+
console.error(`Error merging reports for ${profileName} + ${browserName}:`, e);
|
|
59
59
|
throw e;
|
|
60
60
|
}
|
|
61
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeReports.js","sourceRoot":"","sources":["../../../start/helpers/mergeReports.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"mergeReports.js","sourceRoot":"","sources":["../../../start/helpers/mergeReports.ts"],"names":[],"mappings":";;;;;AAAA,+BAA+B;AAC/B,iDAAyC;AACzC,gDAAwB;AACxB,2BAA6C;AAC7C,gEAAwC;AAExC;;;;;;;GAOG;AACH,MAAM,YAAY,GAAG,CACnB,IAIC,EACK,EAAE;IACR,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAEtD,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAClC,UAAU,EACV,GAAG,WAAW,IAAI,WAAW,EAAE,EAC/B,kBAAkB,CACnB,CAAC;IACF,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAC9B,UAAU,EACV,GAAG,WAAW,IAAI,WAAW,EAAE,EAC/B,kBAAkB,CACnB,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,gCAAgC,WAAW,MAAM,WAAW,GAAG,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,4BAA4B,kBAAkB,EAAE,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,wBAAwB,cAAc,EAAE,CAAC,CAAC;IAEtD,IAAI,CAAC,IAAA,eAAU,EAAC,kBAAkB,CAAC,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,uDAAuD,kBAAkB,EAAE,CAAC;QAC7F,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,2CAA2C;IAC3C,MAAM,KAAK,GAAG,IAAA,gBAAW,E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AC;IAC7E,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,6BAA6B,WAAW,MAAM,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC;QAC/E,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
|
|
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
* @param commaSeparatedString the comma-separated string to parse
|
|
7
7
|
* @returns array of trimmed, non-empty values
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
const parseCommaSeparated = (commaSeparatedString) => {
|
|
10
10
|
if (!commaSeparatedString) {
|
|
11
11
|
return [];
|
|
12
12
|
}
|
|
13
13
|
return (commaSeparatedString
|
|
14
14
|
.split(',')
|
|
15
|
-
.map(
|
|
15
|
+
.map((value) => {
|
|
16
16
|
return value.trim();
|
|
17
17
|
})
|
|
18
|
-
.filter(
|
|
18
|
+
.filter((value) => {
|
|
19
19
|
return value.length > 0;
|
|
20
20
|
}));
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseCommaSeparated.js","sourceRoot":"","sources":["../../../start/helpers/parseCommaSeparated.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"parseCommaSeparated.js","sourceRoot":"","sources":["../../../start/helpers/parseCommaSeparated.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,CAAC,oBAA6B,EAAY,EAAE;IACtE,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CACL,oBAAoB;SACjB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,CAAC,CAAC,CACL,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
* @param padding amount of padding to add
|
|
9
9
|
* @returns number of chars in the buffer
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
const leftBuffer = (message, padding) => {
|
|
12
12
|
return (Math.floor(process.stdout.columns / 2) - padding - Math.ceil(message.length / 2));
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
@@ -18,7 +18,7 @@ var leftBuffer = function (message, padding) {
|
|
|
18
18
|
* @param padding amount of padding to add
|
|
19
19
|
* @returns number of chars in the buffer
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
const rightBuffer = (message, padding) => {
|
|
22
22
|
return (Math.ceil(process.stdout.columns / 2) - padding - Math.floor(message.length / 2));
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
@@ -28,7 +28,7 @@ var rightBuffer = function (message, padding) {
|
|
|
28
28
|
* @param border single character to use as a border
|
|
29
29
|
* @returns text to print
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
const surroundWithBuffer = (str, border) => {
|
|
32
32
|
return (border
|
|
33
33
|
+ ' '.repeat(leftBuffer(str, border.length))
|
|
34
34
|
+ str
|
|
@@ -42,7 +42,7 @@ var surroundWithBuffer = function (str, border) {
|
|
|
42
42
|
* @param char character to place as the buffer
|
|
43
43
|
* @returns text to print
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
const surroundWithChars = (str, char) => {
|
|
46
46
|
if (str.length > process.stdout.columns) {
|
|
47
47
|
return str;
|
|
48
48
|
}
|
|
@@ -59,14 +59,14 @@ var surroundWithChars = function (str, char) {
|
|
|
59
59
|
+ char.repeat(rightBuffer(str, 1)));
|
|
60
60
|
};
|
|
61
61
|
// Prompt instance
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
let cachedPrompt;
|
|
63
|
+
const print = {
|
|
64
64
|
/**
|
|
65
65
|
* Print a title
|
|
66
66
|
* @author Gabe Abrams
|
|
67
67
|
* @param str text to print
|
|
68
68
|
*/
|
|
69
|
-
title:
|
|
69
|
+
title: (str) => {
|
|
70
70
|
if (str.length > process.stdout.columns) {
|
|
71
71
|
return console.log(str);
|
|
72
72
|
}
|
|
@@ -79,7 +79,7 @@ var print = {
|
|
|
79
79
|
* @author Gabe Abrams
|
|
80
80
|
* @param str text to print
|
|
81
81
|
*/
|
|
82
|
-
subtitle:
|
|
82
|
+
subtitle: (str) => {
|
|
83
83
|
if (str.length > process.stdout.columns) {
|
|
84
84
|
return console.log(str);
|
|
85
85
|
}
|
|
@@ -90,14 +90,14 @@ var print = {
|
|
|
90
90
|
* @author Gabe Abrams
|
|
91
91
|
* @param str text to print
|
|
92
92
|
*/
|
|
93
|
-
centered:
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
centered: (str) => {
|
|
94
|
+
const lines = [];
|
|
95
|
+
let index = 0;
|
|
96
96
|
while (index < str.length) {
|
|
97
97
|
lines.push(str.substring(index, Math.min(index + process.stdout.columns, str.length)));
|
|
98
98
|
index += process.stdout.columns;
|
|
99
99
|
}
|
|
100
|
-
lines.forEach(
|
|
100
|
+
lines.forEach((line, lineIndex) => {
|
|
101
101
|
if (lineIndex !== lines.length - 1) {
|
|
102
102
|
// No need to center: fills whole line
|
|
103
103
|
console.log(line);
|
|
@@ -113,12 +113,12 @@ var print = {
|
|
|
113
113
|
* @author Gabe Abrams
|
|
114
114
|
* @param err error message
|
|
115
115
|
*/
|
|
116
|
-
fatalError:
|
|
116
|
+
fatalError: (err) => {
|
|
117
117
|
console.log('\n');
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
const errLine1 = err.substring(0, process.stdout.columns - 6);
|
|
119
|
+
const errLine2 = err.substring(process.stdout.columns - 6);
|
|
120
120
|
console.log('\u2554' + '\u2550'.repeat(3) + '\u2557 ');
|
|
121
|
-
console.log(
|
|
121
|
+
console.log(`\u2551 ! \u2551 ${errLine1}`);
|
|
122
122
|
console.log('\u255A' + '\u2550'.repeat(3) + '\u255D ' + errLine2);
|
|
123
123
|
process.exit(0);
|
|
124
124
|
},
|
|
@@ -127,15 +127,15 @@ var print = {
|
|
|
127
127
|
* @author Gabe Abrams
|
|
128
128
|
* @param promptInstance instance of prompt-sync
|
|
129
129
|
*/
|
|
130
|
-
savePrompt:
|
|
130
|
+
savePrompt: (promptInstance) => {
|
|
131
131
|
cachedPrompt = promptInstance;
|
|
132
132
|
},
|
|
133
133
|
/**
|
|
134
134
|
* Ask the user to press enter before continuing
|
|
135
135
|
* @author Gabe Abrams
|
|
136
136
|
*/
|
|
137
|
-
enterToContinue:
|
|
138
|
-
|
|
137
|
+
enterToContinue: () => {
|
|
138
|
+
const res = cachedPrompt(surroundWithChars('enter to continue, ctrl+c to quit', '\u257C'), true);
|
|
139
139
|
if (res === null) {
|
|
140
140
|
process.exit(0);
|
|
141
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../../start/helpers/print.ts"],"names":[],"mappings":";AAAA,+BAA+B;;AAE/B;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../../start/helpers/print.ts"],"names":[],"mappings":";AAAA,+BAA+B;;AAE/B;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,OAAe,EAAU,EAAE;IAC9D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,CAAC,OAAe,EA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AAmB,EAAE,EAAE;QAClC,YAAY,GAAG,cAAc,CAAC;IAChC,CAAC;IACD;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE;QACpB,MAAM,GAAG,GAAG,YAAY,CACtB,iBAAiB,CAAC,mCAAmC,EAAE,QAAQ,CAAC,EAChE,IAAI,CACL,CAAC;QACF,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC;AAEF,kBAAe,KAAK,CAAC"}
|
|
@@ -3,17 +3,17 @@ 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
|
-
|
|
8
|
-
|
|
6
|
+
const prompt_sync_1 = __importDefault(require("prompt-sync"));
|
|
7
|
+
const print_1 = __importDefault(require("./print"));
|
|
8
|
+
const promptSync = (0, prompt_sync_1.default)();
|
|
9
9
|
/**
|
|
10
10
|
* Ask the user a question
|
|
11
11
|
* @param title title of the question
|
|
12
12
|
* @param notRequired true if question is not required
|
|
13
13
|
* @returns response
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const prompt = (title, notRequired) => {
|
|
16
|
+
const val = promptSync(title);
|
|
17
17
|
if (val === null || (!notRequired && !val)) {
|
|
18
18
|
process.exit(0);
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../start/helpers/prompt.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../start/helpers/prompt.ts"],"names":[],"mappings":";;;;;AAAA,8DAAqC;AACrC,oDAA4B;AAE5B,MAAM,UAAU,GAAG,IAAA,qBAAU,GAAE,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,WAAqB,EAAU,EAAE;IAC9D,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,gCAAgC;AAChC,eAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAEzB,kBAAe,MAAM,CAAC"}
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable no-console */
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
5
|
};
|
|
17
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
7
|
// Import libs
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
22
11
|
// Import helpers
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
13
|
+
const generateReporterConfig_1 = __importDefault(require("./generateReporterConfig"));
|
|
14
|
+
const mergeReports_1 = __importDefault(require("./mergeReports"));
|
|
15
|
+
const generateHtmlReport_1 = __importDefault(require("./generateHtmlReport"));
|
|
27
16
|
// Import constants
|
|
28
|
-
|
|
17
|
+
const DEFAULT_THREADS_PER_COMBO_1 = __importDefault(require("../constants/DEFAULT_THREADS_PER_COMBO"));
|
|
29
18
|
/**
|
|
30
19
|
* Run Cypress in headless mode for a single profile and browser using cypress-parallel
|
|
31
20
|
* @author Yuen Ler Chow
|
|
@@ -36,40 +25,40 @@ var DEFAULT_THREADS_PER_COMBO_1 = __importDefault(require("../constants/DEFAULT_
|
|
|
36
25
|
* @param [opts.numThreads] - The number of parallel threads to use (default: 2)
|
|
37
26
|
* @returns Promise that resolves with run result
|
|
38
27
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return new Promise(
|
|
42
|
-
|
|
28
|
+
const runCypressHeadless = (opts) => {
|
|
29
|
+
const { profileName, browser, outputDir, numThreads = DEFAULT_THREADS_PER_COMBO_1.default, } = opts;
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const root = (0, getRootPath_1.default)();
|
|
43
32
|
// Ensure output directory exists
|
|
44
33
|
if (!fs_1.default.existsSync(outputDir)) {
|
|
45
34
|
fs_1.default.mkdirSync(outputDir, { recursive: true });
|
|
46
35
|
}
|
|
47
36
|
// Create subdirectory for this profile+browser combination
|
|
48
|
-
|
|
37
|
+
const comboDir = path_1.default.join(outputDir, `${profileName}-${browser}`);
|
|
49
38
|
if (!fs_1.default.existsSync(comboDir)) {
|
|
50
39
|
fs_1.default.mkdirSync(comboDir, { recursive: true });
|
|
51
40
|
}
|
|
52
41
|
// Create per-combo screenshots directory
|
|
53
|
-
|
|
42
|
+
const comboScreenshotsDir = path_1.default.join(comboDir, 'screenshots');
|
|
54
43
|
if (!fs_1.default.existsSync(comboScreenshotsDir)) {
|
|
55
44
|
fs_1.default.mkdirSync(comboScreenshotsDir, { recursive: true });
|
|
56
45
|
}
|
|
57
|
-
|
|
58
|
-
console.log(
|
|
59
|
-
console.log(
|
|
46
|
+
const env = Object.assign(Object.assign({}, process.env), { CYPRESS_PROFILE: profileName, BROWSER: browser });
|
|
47
|
+
console.log(`\n🚀 Starting Cypress headless: ${profileName} + ${browser}`);
|
|
48
|
+
console.log(`Output: ${comboDir}\n`);
|
|
60
49
|
// Create reporter config for cypress-multi-reporters
|
|
61
|
-
|
|
62
|
-
|
|
50
|
+
const reporterConfigPath = path_1.default.join(comboDir, 'reporter-config.json');
|
|
51
|
+
const reporterConfig = (0, generateReporterConfig_1.default)({
|
|
63
52
|
resultsDir: outputDir,
|
|
64
|
-
profileName
|
|
53
|
+
profileName,
|
|
65
54
|
browserName: browser,
|
|
66
55
|
});
|
|
67
56
|
fs_1.default.writeFileSync(reporterConfigPath, JSON.stringify(reporterConfig, null, 2));
|
|
68
57
|
// Cypress parallel run command with browser, threads, and reporter config
|
|
69
|
-
|
|
70
|
-
console.log(
|
|
71
|
-
console.log(
|
|
72
|
-
|
|
58
|
+
const cypressArgsString = `--headless --browser ${browser} --config screenshotsFolder=${comboScreenshotsDir} --reporter cypress-multi-reporters --reporter-options configFile=${reporterConfigPath}`;
|
|
59
|
+
console.log(`Reporter config path: ${reporterConfigPath}`);
|
|
60
|
+
console.log(`Granular results dir: ${path_1.default.join(comboDir, 'granular-results')}`);
|
|
61
|
+
const args = [
|
|
73
62
|
'cypress-parallel',
|
|
74
63
|
'-s',
|
|
75
64
|
'ky:headless-helper',
|
|
@@ -81,57 +70,57 @@ var runCypressHeadless = function (opts) {
|
|
|
81
70
|
'false',
|
|
82
71
|
'-a',
|
|
83
72
|
// eslint-disable-next-line quotes
|
|
84
|
-
|
|
73
|
+
`'"${cypressArgsString}"'`,
|
|
85
74
|
];
|
|
86
|
-
|
|
75
|
+
const cypressProcess = (0, child_process_1.spawn)('npx', args, {
|
|
87
76
|
cwd: root,
|
|
88
|
-
env
|
|
77
|
+
env,
|
|
89
78
|
stdio: 'inherit',
|
|
90
79
|
shell: true,
|
|
91
80
|
});
|
|
92
|
-
cypressProcess.on('close',
|
|
93
|
-
|
|
81
|
+
cypressProcess.on('close', (code) => {
|
|
82
|
+
const success = code === 0;
|
|
94
83
|
// Merge granular mochawesome JSON and generate a single HTML report
|
|
95
|
-
|
|
84
|
+
let reportGenerated = true;
|
|
96
85
|
try {
|
|
97
86
|
// Merge all json test suites (test files) into one report
|
|
98
87
|
(0, mergeReports_1.default)({
|
|
99
88
|
resultsDir: outputDir,
|
|
100
|
-
profileName
|
|
89
|
+
profileName,
|
|
101
90
|
browserName: browser,
|
|
102
91
|
});
|
|
103
92
|
// Generate combined HTML report for all test suites for this single browser+profile combo
|
|
104
93
|
(0, generateHtmlReport_1.default)({
|
|
105
94
|
resultsDir: outputDir,
|
|
106
|
-
profileName
|
|
95
|
+
profileName,
|
|
107
96
|
browserName: browser,
|
|
108
97
|
});
|
|
109
98
|
}
|
|
110
99
|
catch (reportError) {
|
|
111
|
-
console.error(
|
|
100
|
+
console.error(`\n⚠️ Report generation failed for ${profileName} + ${browser}:`, reportError);
|
|
112
101
|
reportGenerated = false;
|
|
113
102
|
}
|
|
114
103
|
// By default, marge names the HTML after the JSON basename: report-data.html
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
profileName
|
|
118
|
-
browser
|
|
104
|
+
const reportPath = path_1.default.join(outputDir, `${profileName}-${browser}`, 'report', 'report-data.html');
|
|
105
|
+
const result = {
|
|
106
|
+
profileName,
|
|
107
|
+
browser,
|
|
119
108
|
success: success && reportGenerated,
|
|
120
109
|
outputDir: comboDir,
|
|
121
110
|
reportPath: reportGenerated ? reportPath : undefined,
|
|
122
111
|
};
|
|
123
112
|
if (success && reportGenerated) {
|
|
124
|
-
console.log(
|
|
113
|
+
console.log(`\n✅ Completed: ${profileName} + ${browser}`);
|
|
125
114
|
}
|
|
126
115
|
else if (!reportGenerated) {
|
|
127
|
-
console.log(
|
|
116
|
+
console.log(`\n⚠️ Tests ran but report generation failed: ${profileName} + ${browser}`);
|
|
128
117
|
}
|
|
129
118
|
else {
|
|
130
|
-
console.log(
|
|
119
|
+
console.log(`\n❌ Failed: ${profileName} + ${browser} (exit code: ${code})`);
|
|
131
120
|
}
|
|
132
121
|
resolve(result);
|
|
133
122
|
});
|
|
134
|
-
cypressProcess.on('error',
|
|
123
|
+
cypressProcess.on('error', (error) => {
|
|
135
124
|
reject(error);
|
|
136
125
|
});
|
|
137
126
|
});
|