dceky 1.0.5-beta.ky-declarations.13 → 1.0.5
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/README.md +45 -29
- package/lib/commands/assertDoesNotHaveClass.d.ts +18 -0
- package/lib/commands/assertDoesNotHaveClass.js +17 -0
- package/lib/commands/assertDoesNotHaveClass.js.map +1 -0
- package/lib/commands/assertHasClass.d.ts +18 -0
- package/lib/commands/assertHasClass.js +17 -0
- package/lib/commands/assertHasClass.js.map +1 -0
- package/lib/commands/assertNumElements.d.ts +18 -0
- package/lib/commands/assertNumElements.js +17 -0
- package/lib/commands/assertNumElements.js.map +1 -0
- package/lib/commands/clickWithRetry.d.ts +19 -0
- package/lib/commands/clickWithRetry.js +29 -0
- package/lib/commands/clickWithRetry.js.map +1 -0
- package/lib/commands/genTextOfLength.d.ts +20 -0
- package/lib/commands/genTextOfLength.js +20 -0
- package/lib/commands/genTextOfLength.js.map +1 -0
- package/lib/commands/getAttribute.d.ts +20 -0
- package/lib/commands/getAttribute.js +22 -0
- package/lib/commands/getAttribute.js.map +1 -0
- package/lib/commands/getClassName.d.ts +15 -0
- package/lib/commands/getClassName.js +21 -0
- package/lib/commands/getClassName.js.map +1 -0
- package/lib/commands/getCurrentDateInfo.d.ts +21 -0
- package/lib/commands/getCurrentDateInfo.js +25 -0
- package/lib/commands/getCurrentDateInfo.js.map +1 -0
- package/lib/commands/getId.d.ts +15 -0
- package/lib/commands/getId.js +21 -0
- package/lib/commands/getId.js.map +1 -0
- package/lib/commands/getNumElements.d.ts +14 -0
- package/lib/commands/getNumElements.js +19 -0
- package/lib/commands/getNumElements.js.map +1 -0
- package/lib/commands/getSpecialChars.d.ts +14 -0
- package/lib/commands/getSpecialChars.js +16 -0
- package/lib/commands/getSpecialChars.js.map +1 -0
- package/lib/commands/getTitle.d.ts +13 -0
- package/lib/commands/getTitle.js +20 -0
- package/lib/commands/getTitle.js.map +1 -0
- package/lib/commands/handleHarvardKey.d.ts +18 -0
- package/lib/commands/handleHarvardKey.js +56 -0
- package/lib/commands/handleHarvardKey.js.map +1 -0
- package/lib/commands/handleHarvardKey2.d.ts +14 -0
- package/lib/commands/handleHarvardKey2.js +88 -0
- package/lib/commands/handleHarvardKey2.js.map +1 -0
- package/lib/commands/launchAs.d.ts +20 -0
- package/lib/commands/launchAs.js +60 -0
- package/lib/commands/launchAs.js.map +1 -0
- package/lib/commands/launchLTIUsingToken.d.ts +19 -0
- package/lib/commands/launchLTIUsingToken.js +74 -0
- package/lib/commands/launchLTIUsingToken.js.map +1 -0
- package/lib/commands/listSelectLabels.d.ts +15 -0
- package/lib/commands/listSelectLabels.js +24 -0
- package/lib/commands/listSelectLabels.js.map +1 -0
- package/lib/commands/listSelectValues.d.ts +15 -0
- package/lib/commands/listSelectValues.js +26 -0
- package/lib/commands/listSelectValues.js.map +1 -0
- package/lib/commands/navigateToHref.d.ts +19 -0
- package/lib/commands/navigateToHref.js +23 -0
- package/lib/commands/navigateToHref.js.map +1 -0
- package/lib/commands/padWithZeros.d.ts +20 -0
- package/lib/commands/padWithZeros.js +24 -0
- package/lib/commands/padWithZeros.js.map +1 -0
- package/lib/commands/runScript.d.ts +16 -0
- package/lib/commands/runScript.js +25 -0
- package/lib/commands/runScript.js.map +1 -0
- package/lib/commands/typeInto.d.ts +20 -0
- package/lib/commands/typeInto.js +28 -0
- package/lib/commands/typeInto.js.map +1 -0
- package/lib/commands/uniquify.d.ts +15 -0
- package/lib/commands/uniquify.js +25 -0
- package/lib/commands/uniquify.js.map +1 -0
- package/lib/commands/visitCanvasEndpoint.d.ts +27 -0
- package/lib/commands/visitCanvasEndpoint.js +35 -0
- package/lib/commands/visitCanvasEndpoint.js.map +1 -0
- package/lib/commands/visitCanvasGETEndpoint.d.ts +20 -0
- package/lib/commands/visitCanvasGETEndpoint.js +26 -0
- package/lib/commands/visitCanvasGETEndpoint.js.map +1 -0
- package/lib/commands/waitForAtLeastOneElementPresent.d.ts +23 -0
- package/lib/commands/waitForAtLeastOneElementPresent.js +27 -0
- package/lib/commands/waitForAtLeastOneElementPresent.js.map +1 -0
- package/lib/commands/waitForElementVisible.d.ts +14 -0
- package/lib/commands/waitForElementVisible.js +20 -0
- package/lib/commands/waitForElementVisible.js.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/init.d.ts +6 -0
- package/lib/init.js +69 -0
- package/lib/init.js.map +1 -0
- package/lib/src/commands/extractDataFromClass.d.ts +7 -4
- package/lib/src/commands/extractDataFromClass.js +2 -1
- package/lib/src/commands/extractDataFromClass.js.map +1 -1
- package/lib/src/commands/extractDataFromClassByContents.d.ts +9 -5
- package/lib/src/commands/extractDataFromClassByContents.js +2 -1
- package/lib/src/commands/extractDataFromClassByContents.js.map +1 -1
- package/lib/src/commands/genTextOfLength.d.ts +20 -0
- package/lib/src/commands/genTextOfLength.js +20 -0
- package/lib/src/commands/genTextOfLength.js.map +1 -0
- package/lib/src/commands/getAttribute.d.ts +20 -0
- package/lib/src/commands/getAttribute.js +22 -0
- package/lib/src/commands/getAttribute.js.map +1 -0
- package/lib/src/commands/getClassName.d.ts +15 -0
- package/lib/src/commands/getClassName.js +21 -0
- package/lib/src/commands/getClassName.js.map +1 -0
- package/lib/src/commands/getCurrentDateInfo.d.ts +21 -0
- package/lib/src/commands/getCurrentDateInfo.js +25 -0
- package/lib/src/commands/getCurrentDateInfo.js.map +1 -0
- package/lib/src/commands/getId.d.ts +15 -0
- package/lib/src/commands/getId.js +21 -0
- package/lib/src/commands/getId.js.map +1 -0
- package/lib/src/commands/getJSON.d.ts +0 -1
- package/lib/src/commands/getJSON.js +1 -4
- package/lib/src/commands/getJSON.js.map +1 -1
- package/lib/src/commands/getSpecialChars.d.ts +14 -0
- package/lib/src/commands/getSpecialChars.js +16 -0
- package/lib/src/commands/getSpecialChars.js.map +1 -0
- package/lib/src/commands/getTitle.d.ts +13 -0
- package/lib/src/commands/getTitle.js +20 -0
- package/lib/src/commands/getTitle.js.map +1 -0
- package/lib/src/commands/index.js +29 -5
- package/lib/src/commands/index.js.map +1 -1
- package/lib/src/commands/launchLTIUsingToken.js +12 -4
- package/lib/src/commands/launchLTIUsingToken.js.map +1 -1
- package/lib/src/commands/listSelectLabels.d.ts +15 -0
- package/lib/src/commands/listSelectLabels.js +24 -0
- package/lib/src/commands/listSelectLabels.js.map +1 -0
- package/lib/src/commands/listSelectValues.d.ts +15 -0
- package/lib/src/commands/listSelectValues.js +27 -0
- package/lib/src/commands/listSelectValues.js.map +1 -0
- package/lib/src/commands/padWithZeros.d.ts +20 -0
- package/lib/src/commands/padWithZeros.js +24 -0
- package/lib/src/commands/padWithZeros.js.map +1 -0
- package/lib/src/commands/uniquify.d.ts +15 -0
- package/lib/src/commands/uniquify.js +26 -0
- package/lib/src/commands/uniquify.js.map +1 -0
- package/lib/src/commands/visitCanvasEndpoint.d.ts +26 -0
- package/lib/src/commands/visitCanvasEndpoint.js +36 -0
- package/lib/src/commands/visitCanvasEndpoint.js.map +1 -0
- package/lib/src/commands/waitForAtLeastOneElementPresent.d.ts +23 -0
- package/lib/src/commands/waitForAtLeastOneElementPresent.js +28 -0
- package/lib/src/commands/waitForAtLeastOneElementPresent.js.map +1 -0
- package/lib/src/init.js +28 -2
- package/lib/src/init.js.map +1 -1
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.d.ts +6 -0
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js +9 -0
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js.map +1 -0
- package/lib/start/helpers/collectPngFiles.d.ts +9 -0
- package/lib/start/helpers/collectPngFiles.js +31 -0
- package/lib/start/helpers/collectPngFiles.js.map +1 -0
- package/lib/start/helpers/executeAllHeadlessCombinations.d.ts +15 -0
- package/lib/start/helpers/executeAllHeadlessCombinations.js +116 -0
- package/lib/start/helpers/executeAllHeadlessCombinations.js.map +1 -0
- package/lib/start/helpers/executeCypress.d.ts +17 -0
- package/lib/start/helpers/executeCypress.js +103 -0
- package/lib/start/helpers/executeCypress.js.map +1 -0
- package/lib/start/helpers/generateHtmlReport.d.ts +14 -0
- package/lib/start/helpers/generateHtmlReport.js +54 -0
- package/lib/start/helpers/generateHtmlReport.js.map +1 -0
- package/lib/start/helpers/generateReportHomepage.d.ts +9 -0
- package/lib/start/helpers/generateReportHomepage.js +142 -0
- package/lib/start/helpers/generateReportHomepage.js.map +1 -0
- package/lib/start/helpers/generateReporterConfig.d.ts +17 -0
- package/lib/start/helpers/generateReporterConfig.js +32 -0
- package/lib/start/helpers/generateReporterConfig.js.map +1 -0
- package/lib/start/helpers/getDateLabeledDir.d.ts +7 -0
- package/lib/start/helpers/getDateLabeledDir.js +38 -0
- package/lib/start/helpers/getDateLabeledDir.js.map +1 -0
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.d.ts +11 -0
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js +121 -0
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js.map +1 -0
- package/lib/start/helpers/mergeReports.d.ts +14 -0
- package/lib/start/helpers/mergeReports.js +63 -0
- package/lib/start/helpers/mergeReports.js.map +1 -0
- package/lib/start/helpers/reportHomepage.ejs +272 -0
- package/lib/start/helpers/runCypressHeadless.d.ts +18 -0
- package/lib/start/helpers/runCypressHeadless.js +138 -0
- package/lib/start/helpers/runCypressHeadless.js.map +1 -0
- package/lib/start/helpers/runCypressVisible.d.ts +8 -0
- package/lib/start/helpers/runCypressVisible.js +53 -0
- package/lib/start/helpers/runCypressVisible.js.map +1 -0
- package/lib/start/index.js +23 -5
- package/lib/start/index.js.map +1 -1
- package/lib/start/types/MochawesomeReporterConfig.d.ts +15 -0
- package/lib/start/types/MochawesomeReporterConfig.js +3 -0
- package/lib/start/types/MochawesomeReporterConfig.js.map +1 -0
- package/lib/start/types/Profile.d.ts +9 -0
- package/lib/start/types/Profile.js +3 -0
- package/lib/start/types/Profile.js.map +1 -0
- package/lib/start/types/ReportInfo.d.ts +14 -0
- package/lib/start/types/ReportInfo.js +3 -0
- package/lib/start/types/ReportInfo.js.map +1 -0
- package/lib/start/types/RunResult.d.ts +12 -0
- package/lib/start/types/RunResult.js +3 -0
- package/lib/start/types/RunResult.js.map +1 -0
- package/lib/start/types/ScreenshotInfo.d.ts +10 -0
- package/lib/start/types/ScreenshotInfo.js +3 -0
- package/lib/start/types/ScreenshotInfo.js.map +1 -0
- package/lib/start/types/TemplateReportInfo.d.ts +12 -0
- package/lib/start/types/TemplateReportInfo.js +3 -0
- package/lib/start/types/TemplateReportInfo.js.map +1 -0
- package/package.json +10 -8
- package/src/commands/extractDataFromClass.ts +17 -6
- package/src/commands/extractDataFromClassByContents.ts +21 -8
- package/src/commands/genTextOfLength.ts +54 -0
- package/src/commands/getAttribute.ts +58 -0
- package/src/commands/getClassName.ts +44 -0
- package/src/commands/getCurrentDateInfo.ts +57 -0
- package/src/commands/getId.ts +44 -0
- package/src/commands/getJSON.ts +0 -4
- package/src/commands/getSpecialChars.ts +34 -0
- package/src/commands/getTitle.ts +39 -0
- package/src/commands/index.ts +29 -5
- package/src/commands/launchLTIUsingToken.ts +12 -4
- package/src/commands/listSelectLabels.ts +47 -0
- package/src/commands/listSelectValues.ts +50 -0
- package/src/commands/padWithZeros.ts +53 -0
- package/src/commands/uniquify.ts +49 -0
- package/src/commands/visitCanvasEndpoint.ts +75 -0
- package/src/commands/waitForAtLeastOneElementPresent.ts +64 -0
- package/start/constants/DEFAULT_THREADS_PER_COMBO.ts +7 -0
- package/start/helpers/collectPngFiles.ts +25 -0
- package/start/helpers/executeAllHeadlessCombinations.ts +92 -0
- package/start/helpers/executeCypress.ts +66 -0
- package/start/helpers/generateHtmlReport.ts +71 -0
- package/start/helpers/generateReportHomepage.ts +148 -0
- package/start/helpers/generateReporterConfig.ts +39 -0
- package/start/helpers/getDateLabeledDir.ts +43 -0
- package/start/helpers/mergeAllReportsAndGenerateHtml.ts +150 -0
- package/start/helpers/mergeReports.ts +82 -0
- package/start/helpers/reportHomepage.ejs +272 -0
- package/start/helpers/runCypressHeadless.ts +164 -0
- package/start/helpers/runCypressVisible.ts +45 -0
- package/start/index.ts +23 -5
- package/start/types/MochawesomeReporterConfig.ts +23 -0
- package/start/types/Profile.ts +12 -0
- package/start/types/ReportInfo.ts +22 -0
- package/start/types/RunResult.ts +18 -0
- package/start/types/ScreenshotInfo.ts +13 -0
- package/start/types/TemplateReportInfo.ts +16 -0
- package/src/commands/visitCanvasGETEndpoint.ts +0 -61
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
// Import libs
|
|
19
|
+
var child_process_1 = require("child_process");
|
|
20
|
+
var path_1 = __importDefault(require("path"));
|
|
21
|
+
var fs_1 = __importDefault(require("fs"));
|
|
22
|
+
// Import helpers
|
|
23
|
+
var getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
24
|
+
var generateReporterConfig_1 = __importDefault(require("./generateReporterConfig"));
|
|
25
|
+
var mergeReports_1 = __importDefault(require("./mergeReports"));
|
|
26
|
+
var generateHtmlReport_1 = __importDefault(require("./generateHtmlReport"));
|
|
27
|
+
// Import constants
|
|
28
|
+
var DEFAULT_THREADS_PER_COMBO_1 = __importDefault(require("../constants/DEFAULT_THREADS_PER_COMBO"));
|
|
29
|
+
/**
|
|
30
|
+
* Run Cypress in headless mode for a single profile and browser using cypress-parallel
|
|
31
|
+
* @author Yuen Ler Chow
|
|
32
|
+
* @param opts - object of arguments
|
|
33
|
+
* @param opts.profileName - The profile name to use
|
|
34
|
+
* @param opts.browser - The browser to use
|
|
35
|
+
* @param opts.outputDir - The output directory for results
|
|
36
|
+
* @param [opts.numThreads] - The number of parallel threads to use (default: 2)
|
|
37
|
+
* @returns Promise that resolves with run result
|
|
38
|
+
*/
|
|
39
|
+
var runCypressHeadless = function (opts) {
|
|
40
|
+
var profileName = opts.profileName, browser = opts.browser, outputDir = opts.outputDir, _a = opts.numThreads, numThreads = _a === void 0 ? DEFAULT_THREADS_PER_COMBO_1.default : _a;
|
|
41
|
+
return new Promise(function (resolve, reject) {
|
|
42
|
+
var root = (0, getRootPath_1.default)();
|
|
43
|
+
// Ensure output directory exists
|
|
44
|
+
if (!fs_1.default.existsSync(outputDir)) {
|
|
45
|
+
fs_1.default.mkdirSync(outputDir, { recursive: true });
|
|
46
|
+
}
|
|
47
|
+
// Create subdirectory for this profile+browser combination
|
|
48
|
+
var comboDir = path_1.default.join(outputDir, "".concat(profileName, "-").concat(browser));
|
|
49
|
+
if (!fs_1.default.existsSync(comboDir)) {
|
|
50
|
+
fs_1.default.mkdirSync(comboDir, { recursive: true });
|
|
51
|
+
}
|
|
52
|
+
// Create per-combo screenshots directory
|
|
53
|
+
var comboScreenshotsDir = path_1.default.join(comboDir, 'screenshots');
|
|
54
|
+
if (!fs_1.default.existsSync(comboScreenshotsDir)) {
|
|
55
|
+
fs_1.default.mkdirSync(comboScreenshotsDir, { recursive: true });
|
|
56
|
+
}
|
|
57
|
+
var env = __assign(__assign({}, process.env), { CYPRESS_PROFILE: profileName, BROWSER: browser });
|
|
58
|
+
console.log("\n\uD83D\uDE80 Starting Cypress headless: ".concat(profileName, " + ").concat(browser));
|
|
59
|
+
console.log("Output: ".concat(comboDir, "\n"));
|
|
60
|
+
// Create reporter config for cypress-multi-reporters
|
|
61
|
+
var reporterConfigPath = path_1.default.join(comboDir, 'reporter-config.json');
|
|
62
|
+
var reporterConfig = (0, generateReporterConfig_1.default)({
|
|
63
|
+
resultsDir: outputDir,
|
|
64
|
+
profileName: profileName,
|
|
65
|
+
browserName: browser,
|
|
66
|
+
});
|
|
67
|
+
fs_1.default.writeFileSync(reporterConfigPath, JSON.stringify(reporterConfig, null, 2));
|
|
68
|
+
// Cypress parallel run command with browser, threads, and reporter config
|
|
69
|
+
var cypressArgsString = "--headless --browser ".concat(browser, " --config screenshotsFolder=").concat(comboScreenshotsDir, " --reporter cypress-multi-reporters --reporter-options configFile=").concat(reporterConfigPath);
|
|
70
|
+
console.log("Reporter config path: ".concat(reporterConfigPath));
|
|
71
|
+
console.log("Granular results dir: ".concat(path_1.default.join(comboDir, 'granular-results')));
|
|
72
|
+
var args = [
|
|
73
|
+
'cypress-parallel',
|
|
74
|
+
'-s',
|
|
75
|
+
'cy:run',
|
|
76
|
+
'--threads',
|
|
77
|
+
numThreads.toString(),
|
|
78
|
+
'-d',
|
|
79
|
+
'cypress/e2e/**/*',
|
|
80
|
+
'-a',
|
|
81
|
+
// eslint-disable-next-line quotes
|
|
82
|
+
"'\"".concat(cypressArgsString, "\"'"),
|
|
83
|
+
];
|
|
84
|
+
var cypressProcess = (0, child_process_1.spawn)('npx', args, {
|
|
85
|
+
cwd: root,
|
|
86
|
+
env: env,
|
|
87
|
+
stdio: 'inherit',
|
|
88
|
+
shell: true,
|
|
89
|
+
});
|
|
90
|
+
cypressProcess.on('close', function (code) {
|
|
91
|
+
var success = code === 0;
|
|
92
|
+
// Merge granular mochawesome JSON and generate a single HTML report
|
|
93
|
+
var reportGenerated = true;
|
|
94
|
+
try {
|
|
95
|
+
// Merge all json test suites (test files) into one report
|
|
96
|
+
(0, mergeReports_1.default)({
|
|
97
|
+
resultsDir: outputDir,
|
|
98
|
+
profileName: profileName,
|
|
99
|
+
browserName: browser,
|
|
100
|
+
});
|
|
101
|
+
// Generate combined HTML report for all test suites for this single browser+profile combo
|
|
102
|
+
(0, generateHtmlReport_1.default)({
|
|
103
|
+
resultsDir: outputDir,
|
|
104
|
+
profileName: profileName,
|
|
105
|
+
browserName: browser,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
catch (reportError) {
|
|
109
|
+
console.error("\n\u26A0\uFE0F Report generation failed for ".concat(profileName, " + ").concat(browser, ":"), reportError);
|
|
110
|
+
reportGenerated = false;
|
|
111
|
+
}
|
|
112
|
+
// By default, marge names the HTML after the JSON basename: report-data.html
|
|
113
|
+
var reportPath = path_1.default.join(outputDir, "".concat(profileName, "-").concat(browser), 'report', 'report-data.html');
|
|
114
|
+
var result = {
|
|
115
|
+
profileName: profileName,
|
|
116
|
+
browser: browser,
|
|
117
|
+
success: success && reportGenerated,
|
|
118
|
+
outputDir: comboDir,
|
|
119
|
+
reportPath: reportGenerated ? reportPath : undefined,
|
|
120
|
+
};
|
|
121
|
+
if (success && reportGenerated) {
|
|
122
|
+
console.log("\n\u2705 Completed: ".concat(profileName, " + ").concat(browser));
|
|
123
|
+
}
|
|
124
|
+
else if (!reportGenerated) {
|
|
125
|
+
console.log("\n\u26A0\uFE0F Tests ran but report generation failed: ".concat(profileName, " + ").concat(browser));
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
console.log("\n\u274C Failed: ".concat(profileName, " + ").concat(browser, " (exit code: ").concat(code, ")"));
|
|
129
|
+
}
|
|
130
|
+
resolve(result);
|
|
131
|
+
});
|
|
132
|
+
cypressProcess.on('error', function (error) {
|
|
133
|
+
reject(error);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
exports.default = runCypressHeadless;
|
|
138
|
+
//# sourceMappingURL=runCypressHeadless.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runCypressHeadless.js","sourceRoot":"","sources":["../../../start/helpers/runCypressHeadless.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;;;;;;;;;;;;;;AAE/B,cAA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,CAAC,2BAAe,WAAW,gBAAM,OAAO,0BAAgB,IAAI,MAAG,CAAC,CAAC;YAC9E,CAAC;YAED,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,KAAK;YAC/B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run Cypress in visible/interactive mode with a profile
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
* @param profileName - The profile name to use
|
|
5
|
+
* @returns Promise that resolves when Cypress closes
|
|
6
|
+
*/
|
|
7
|
+
declare const runCypressVisible: (profileName: string) => Promise<void>;
|
|
8
|
+
export default runCypressVisible;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* eslint-disable no-console */
|
|
18
|
+
var child_process_1 = require("child_process");
|
|
19
|
+
// Import helpers
|
|
20
|
+
var getRootPath_1 = __importDefault(require("./getRootPath"));
|
|
21
|
+
/**
|
|
22
|
+
* Run Cypress in visible/interactive mode with a profile
|
|
23
|
+
* @author Yuen Ler Chow
|
|
24
|
+
* @param profileName - The profile name to use
|
|
25
|
+
* @returns Promise that resolves when Cypress closes
|
|
26
|
+
*/
|
|
27
|
+
var runCypressVisible = function (profileName) {
|
|
28
|
+
return new Promise(function (resolve, reject) {
|
|
29
|
+
var root = (0, getRootPath_1.default)();
|
|
30
|
+
var env = __assign(__assign({}, process.env), { CYPRESS_PROFILE: profileName });
|
|
31
|
+
console.log("\n\uD83D\uDE80 Launching Cypress in interactive mode with profile: ".concat(profileName));
|
|
32
|
+
console.log(" CYPRESS_PROFILE=".concat(profileName, "\n"));
|
|
33
|
+
var cypressProcess = (0, child_process_1.spawn)('npx', ['cypress', 'open'], {
|
|
34
|
+
cwd: root,
|
|
35
|
+
env: env,
|
|
36
|
+
stdio: 'inherit',
|
|
37
|
+
shell: true,
|
|
38
|
+
});
|
|
39
|
+
cypressProcess.on('close', function (code) {
|
|
40
|
+
if (code === 0) {
|
|
41
|
+
resolve();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
reject(new Error("Cypress exited with code ".concat(code)));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
cypressProcess.on('error', function (error) {
|
|
48
|
+
reject(error);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
exports.default = runCypressVisible;
|
|
53
|
+
//# sourceMappingURL=runCypressVisible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runCypressVisible.js","sourceRoot":"","sources":["../../../start/helpers/runCypressVisible.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,+CAAsC;AAEtC,iBAAiB;AACjB,8DAAwC;AAExC;;;;;GAKG;AACH,IAAM,iBAAiB,GAAG,UAAC,WAAmB;IAC5C,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACjC,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;QAC3B,IAAM,GAAG,yBACJ,OAAO,CAAC,GAAG,KACd,eAAe,EAAE,WAAW,GAC7B,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,6EAA4D,WAAW,CAAE,CAAC,CAAC;QACvF,OAAO,CAAC,GAAG,CAAC,4BAAqB,WAAW,OAAI,CAAC,CAAC;QAElD,IAAM,cAAc,GAAG,IAAA,qBAAK,EAAC,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE;YACvD,GAAG,EAAE,IAAI;YACT,GAAG,KAAA;YACH,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QAEH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,IAAI;YAC9B,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,KAAK,CAAC,mCAA4B,IAAI,CAAE,CAAC,CAAC,CAAC;YACxD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,KAAK;YAC/B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
|
package/lib/start/index.js
CHANGED
|
@@ -20,8 +20,10 @@ var findProfilesByNames_1 = __importDefault(require("./helpers/findProfilesByNam
|
|
|
20
20
|
var validateBrowsers_1 = __importDefault(require("./helpers/validateBrowsers"));
|
|
21
21
|
var extractArgValue_1 = __importDefault(require("./helpers/extractArgValue"));
|
|
22
22
|
var getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
23
|
+
var executeCypress_1 = __importDefault(require("./helpers/executeCypress"));
|
|
23
24
|
// Import constants
|
|
24
25
|
var AVAILABLE_BROWSERS_1 = __importDefault(require("./constants/AVAILABLE_BROWSERS"));
|
|
26
|
+
var DEFAULT_THREADS_PER_COMBO_1 = __importDefault(require("./constants/DEFAULT_THREADS_PER_COMBO"));
|
|
25
27
|
// Get the project directory
|
|
26
28
|
var pwd = (0, getRootPath_1.default)();
|
|
27
29
|
// Find available profiles under /cypress/profiles
|
|
@@ -73,6 +75,20 @@ var envHeadlessRaw = process.env.HEADLESS;
|
|
|
73
75
|
var headlessFlagValue = (0, extractArgValue_1.default)(args, '--headless');
|
|
74
76
|
var hasHeadlessFlag = headlessFlagValue !== undefined;
|
|
75
77
|
isHeadless = !!(envHeadlessRaw && envHeadlessRaw.toLowerCase() !== 'false') || hasHeadlessFlag;
|
|
78
|
+
// Check for THREADS_PER_COMBO (env var or CLI arg)
|
|
79
|
+
var envThreadsRaw = process.env.THREADS_PER_COMBO;
|
|
80
|
+
var argThreadsRaw = (0, extractArgValue_1.default)(args, '--threadsPerCombo');
|
|
81
|
+
var threadsRaw = envThreadsRaw || argThreadsRaw;
|
|
82
|
+
var threadsPerCombo;
|
|
83
|
+
if (threadsRaw) {
|
|
84
|
+
var parsed = Number.parseInt(threadsRaw, 10);
|
|
85
|
+
if (!Number.isNaN(parsed) && parsed > 0) {
|
|
86
|
+
threadsPerCombo = parsed;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
console.warn("\u26A0\uFE0F Invalid THREADS_PER_COMBO value: \"".concat(threadsRaw, "\". Using default (").concat(DEFAULT_THREADS_PER_COMBO_1.default, ")."));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
76
92
|
// If headless wasn't specified, ask the user to choose
|
|
77
93
|
if (!envHeadlessRaw && !hasHeadlessFlag) {
|
|
78
94
|
var choices = (0, showChooser_1.default)({
|
|
@@ -132,9 +148,11 @@ if (selectedProfiles.length === 0
|
|
|
132
148
|
});
|
|
133
149
|
selectedProfiles = choices.map(function (choice) { return profiles[choice.index]; });
|
|
134
150
|
}
|
|
135
|
-
// Execute
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
151
|
+
// Execute Cypress with selected configuration
|
|
152
|
+
(0, executeCypress_1.default)({
|
|
153
|
+
selectedProfiles: selectedProfiles,
|
|
154
|
+
selectedBrowsers: selectedBrowsers,
|
|
155
|
+
isHeadless: isHeadless,
|
|
156
|
+
threadsPerCombo: threadsPerCombo,
|
|
157
|
+
});
|
|
140
158
|
//# sourceMappingURL=index.js.map
|
package/lib/start/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../start/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B;;;;;GAKG;;;;;AAEH,cAAc;AACd,0CAAoB;AACpB,8CAAwB;AAExB,iBAAiB;AACjB,sEAAgD;AAChD,sFAAgE;AAChE,sFAAgE;AAChE,gFAA0D;AAC1D,8EAAwD;AACxD,sEAAgD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../start/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B;;;;;GAKG;;;;;AAEH,cAAc;AACd,0CAAoB;AACpB,8CAAwB;AAExB,iBAAiB;AACjB,sEAAgD;AAChD,sFAAgE;AAChE,sFAAgE;AAChE,gFAA0D;AAC1D,8EAAwD;AACxD,sEAAgD;AAChD,4EAAsD;AAEtD,mBAAmB;AACnB,sFAAgE;AAChE,oGAA8E;AAE9E,4BAA4B;AAC5B,IAAM,GAAG,GAAG,IAAA,qBAAW,GAAE,CAAC;AAE1B,kDAAkD;AAClD,IAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;AACvD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;IAChC,OAAO,CAAC,IAAI,CAAC,mDAA4C,WAAW,MAAG,CAAC,CAAC;IACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,gEAAgE;AAChE,IAAM,YAAY,GAAG,CACn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AC,MAAM,GAAG,CAAC,CAAC,EAC/C,CAAC;IACD,IAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAC,CAAC,EAAE,GAAG;QAClC,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;YACpB,WAAW,EAAE,CAAC,CAAC,WAAW;SAC3B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAM,OAAO,GAAG,IAAA,qBAAW,EAAC;QAC1B,QAAQ,EAAE,CACR,UAAU;YACR,CAAC,CAAC,+CAA+C;YACjD,CAAC,CAAC,iBAAiB,CACtB;QACD,OAAO,SAAA;QACP,KAAK,EAAE,wBAAiB,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE;QAC/C,UAAU,EAAE,UAAU;KACvB,CAAC,CAAC;IAEH,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,IAAO,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjF,CAAC;AAED,8CAA8C;AAC9C,IAAA,wBAAc,EAAC;IACb,gBAAgB,kBAAA;IAChB,gBAAgB,kBAAA;IAChB,UAAU,YAAA;IACV,eAAe,iBAAA;CAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mochawesome reporter configuration
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
type MochawesomeReporterConfig = {
|
|
6
|
+
reporterEnabled: string;
|
|
7
|
+
mochawesomeReporterOptions: {
|
|
8
|
+
reportDir: string;
|
|
9
|
+
reportFilename: string;
|
|
10
|
+
overwrite: boolean;
|
|
11
|
+
html: boolean;
|
|
12
|
+
json: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default MochawesomeReporterConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MochawesomeReporterConfig.js","sourceRoot":"","sources":["../../../start/types/MochawesomeReporterConfig.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Profile.js","sourceRoot":"","sources":["../../../start/types/Profile.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Information about a generated report
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
type ReportInfo = {
|
|
6
|
+
profileName: string;
|
|
7
|
+
browser: string;
|
|
8
|
+
reportPath: string;
|
|
9
|
+
success: boolean;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
totalTests?: number;
|
|
12
|
+
passedTests?: number;
|
|
13
|
+
};
|
|
14
|
+
export default ReportInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportInfo.js","sourceRoot":"","sources":["../../../start/types/ReportInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunResult.js","sourceRoot":"","sources":["../../../start/types/RunResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenshotInfo.js","sourceRoot":"","sources":["../../../start/types/ScreenshotInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ReportInfo from './ReportInfo';
|
|
2
|
+
import ScreenshotInfo from './ScreenshotInfo';
|
|
3
|
+
/**
|
|
4
|
+
* Extended version of ReportInfo with additional computed fields
|
|
5
|
+
* needed for rendering the EJS report homepage template
|
|
6
|
+
* @author Yuen Ler Chow
|
|
7
|
+
*/
|
|
8
|
+
type TemplateReportInfo = ReportInfo & {
|
|
9
|
+
relativeReportPath: string | null;
|
|
10
|
+
screenshots: ScreenshotInfo[];
|
|
11
|
+
};
|
|
12
|
+
export default TemplateReportInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateReportInfo.js","sourceRoot":"","sources":["../../../start/types/TemplateReportInfo.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dceky",
|
|
3
|
-
"version": "1.0.5
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Cypress toolkit for Harvard DCE",
|
|
5
5
|
"main": "./lib/src/index.js",
|
|
6
6
|
"types": "./lib/src/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc --project ./tsconfig.json",
|
|
8
|
+
"build": "tsc --project ./tsconfig.json && cp start/helpers/reportHomepage.ejs lib/start/helpers/",
|
|
9
9
|
"ky:start": "npx tsx ./start/index.ts",
|
|
10
10
|
"ky:setup": "npx tsx ./setup/index.ts",
|
|
11
11
|
"ky:dev": "npm run ky:setup && npm run ky:start",
|
|
@@ -28,16 +28,17 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/harvard-edtech/dceky#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"@types/clear": "^0.1.4",
|
|
32
|
+
"@types/ejs": "^3.1.5",
|
|
33
|
+
"@types/node": "^22.7.0",
|
|
34
|
+
"@types/prompt-sync": "^4.2.3",
|
|
31
35
|
"child_process": "^1.0.2",
|
|
32
36
|
"clear": "^0.1.0",
|
|
33
37
|
"deepmerge": "4.3.1",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"@types/clear": "^0.1.4",
|
|
37
|
-
"@types/node": "^22.7.0"
|
|
38
|
+
"ejs": "^3.1.10",
|
|
39
|
+
"prompt-sync": "^4.2.0"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"typescript": "^5.9.3",
|
|
41
42
|
"@types/deepmerge": "2.1.0",
|
|
42
43
|
"@types/node": "^24.6.1",
|
|
43
44
|
"cross-env": "^10.1.0",
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
47
48
|
"eslint-plugin-import": "^2.32.0",
|
|
48
49
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
49
|
-
"eslint-plugin-react": "^7.37.5"
|
|
50
|
+
"eslint-plugin-react": "^7.37.5",
|
|
51
|
+
"typescript": "^5.9.3"
|
|
50
52
|
},
|
|
51
53
|
"peerDependencies": {
|
|
52
54
|
"cypress": "^x.x.x"
|
|
@@ -11,14 +11,16 @@ declare global {
|
|
|
11
11
|
* Obtain data from a class attribute that starts with a specific prefix
|
|
12
12
|
* and return it
|
|
13
13
|
* @author Allison Zhang
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
14
|
+
* @param opts the options object
|
|
15
|
+
* @param opts.selector the css selector for finding the element
|
|
16
|
+
* @param opts.classPrefix the prefix to look for in the class attribute
|
|
16
17
|
* @returns the extracted data
|
|
17
|
-
* @example cy.extractDataFromClass('.item', 'data-').then((data) => { ... })
|
|
18
18
|
*/
|
|
19
19
|
extractDataFromClass(
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
opts: {
|
|
21
|
+
selector: string,
|
|
22
|
+
classPrefix: string,
|
|
23
|
+
},
|
|
22
24
|
): Chainable<string[]>;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -29,7 +31,16 @@ declare global {
|
|
|
29
31
|
/*----------------------------------------*/
|
|
30
32
|
|
|
31
33
|
const extractDataFromClass = () => {
|
|
32
|
-
Cypress.Commands.add('extractDataFromClass', (
|
|
34
|
+
Cypress.Commands.add('extractDataFromClass', (
|
|
35
|
+
opts: {
|
|
36
|
+
selector: string,
|
|
37
|
+
classPrefix: string,
|
|
38
|
+
},
|
|
39
|
+
) => {
|
|
40
|
+
const {
|
|
41
|
+
selector,
|
|
42
|
+
classPrefix,
|
|
43
|
+
} = opts;
|
|
33
44
|
return (
|
|
34
45
|
cy
|
|
35
46
|
.get(selector)
|
|
@@ -11,16 +11,18 @@ declare global {
|
|
|
11
11
|
* Obtain data from a class attribute that starts with a specific prefix
|
|
12
12
|
* and with specific contents, and return it
|
|
13
13
|
* @author Allison Zhang
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
14
|
+
* @param opts the options object
|
|
15
|
+
* @param opts.contents the contents of the element to find
|
|
16
|
+
* @param opts.selector the css selector for finding the element
|
|
17
|
+
* @param opts.classPrefix the prefix to look for in the class attribute
|
|
17
18
|
* @returns the extracted data
|
|
18
|
-
* @example cy.extractDataFromClassByContents('Submit', '.button', 'btn-').then((data) => { ... })
|
|
19
19
|
*/
|
|
20
20
|
extractDataFromClassByContents(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
opts: {
|
|
22
|
+
contents: string,
|
|
23
|
+
selector: string,
|
|
24
|
+
classPrefix: string,
|
|
25
|
+
},
|
|
24
26
|
): Chainable<string[]>;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
@@ -31,7 +33,18 @@ declare global {
|
|
|
31
33
|
/*----------------------------------------*/
|
|
32
34
|
|
|
33
35
|
const extractDataFromClassByContents = () => {
|
|
34
|
-
Cypress.Commands.add('extractDataFromClassByContents', (
|
|
36
|
+
Cypress.Commands.add('extractDataFromClassByContents', (
|
|
37
|
+
opts: {
|
|
38
|
+
contents: string,
|
|
39
|
+
selector: string,
|
|
40
|
+
classPrefix: string,
|
|
41
|
+
},
|
|
42
|
+
) => {
|
|
43
|
+
const {
|
|
44
|
+
contents,
|
|
45
|
+
selector,
|
|
46
|
+
classPrefix,
|
|
47
|
+
} = opts;
|
|
35
48
|
return (
|
|
36
49
|
cy
|
|
37
50
|
.get(selector)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
|
|
3
|
+
/*----------------------------------------*/
|
|
4
|
+
/* ---------------- Type ---------------- */
|
|
5
|
+
/*----------------------------------------*/
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
namespace Cypress {
|
|
9
|
+
interface Chainable {
|
|
10
|
+
/**
|
|
11
|
+
* Generate a string of specified length for Cypress tests
|
|
12
|
+
* @author Gardenia Liu, Allison Zhang
|
|
13
|
+
* @param opts options object
|
|
14
|
+
* @param opts.length the desired length of the string
|
|
15
|
+
* @param opts.text optional text to repeat to form the string; defaults to '123456789x' if not provided
|
|
16
|
+
* @returns a string of the specified length, if the length is not a multiple of the text length, it is truncated
|
|
17
|
+
*/
|
|
18
|
+
genTextOfLength(
|
|
19
|
+
opts: {
|
|
20
|
+
length: number,
|
|
21
|
+
text?: string,
|
|
22
|
+
},
|
|
23
|
+
): Chainable<string>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/*----------------------------------------*/
|
|
29
|
+
/* --------------- Command -------------- */
|
|
30
|
+
/*----------------------------------------*/
|
|
31
|
+
|
|
32
|
+
const genTextOfLength = () => {
|
|
33
|
+
Cypress.Commands.add('genTextOfLength', (
|
|
34
|
+
opts: {
|
|
35
|
+
length: number,
|
|
36
|
+
text?: string,
|
|
37
|
+
},
|
|
38
|
+
) => {
|
|
39
|
+
const {
|
|
40
|
+
length,
|
|
41
|
+
text,
|
|
42
|
+
} = opts;
|
|
43
|
+
const textToUse = text || '123456789x';
|
|
44
|
+
const lengthOfTextToUse = Math.ceil(length / textToUse.length);
|
|
45
|
+
const result = textToUse.repeat(lengthOfTextToUse).substring(0, length);
|
|
46
|
+
return cy.wrap(result);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/*----------------------------------------*/
|
|
51
|
+
/* --------------- Export --------------- */
|
|
52
|
+
/*----------------------------------------*/
|
|
53
|
+
|
|
54
|
+
export default genTextOfLength;
|