dceky 1.1.0 → 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 +9 -9
- 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.d.ts +6 -0
- package/lib/setup/genTsConfigFile.js +51 -0
- package/lib/setup/genTsConfigFile.js.map +1 -0
- package/lib/setup/helpers/getRootPath.js +3 -3
- package/lib/setup/helpers/getRootPath.js.map +1 -1
- package/lib/setup/index.js +9 -7
- 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.d.ts +1 -3
- 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.d.ts +2 -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 +6 -4
- package/setup/genE2ELaunchFile.ts +1 -1
- package/setup/genTsConfigFile.ts +55 -0
- package/setup/index.ts +2 -0
- package/src/commands/getCredentialValue.ts +1 -3
- package/src/commands/getProfileValue.ts +2 -1
- package/src/genConfiguration/index.ts +3 -1
- package/tsconfig.json +4 -3
|
@@ -3,14 +3,14 @@ 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
|
-
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
7
|
/**
|
|
8
8
|
* Get the root path of the project
|
|
9
9
|
* @author Yuen Ler Chow
|
|
10
10
|
* @returns the root path of the project
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const getRootPath = () => {
|
|
13
|
+
const root = path_1.default.join(__dirname, '../../../../');
|
|
14
14
|
return root;
|
|
15
15
|
};
|
|
16
16
|
exports.default = getRootPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRootPath.js","sourceRoot":"","sources":["../../../preinstall/helpers/getRootPath.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"getRootPath.js","sourceRoot":"","sources":["../../../preinstall/helpers/getRootPath.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB;;;;GAIG;AACH,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,IAAI,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
package/lib/preinstall/index.js
CHANGED
|
@@ -9,15 +9,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
};
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
// Import libs
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const fs_1 = __importDefault(require("fs"));
|
|
13
|
+
const path_1 = __importDefault(require("path"));
|
|
14
14
|
// Import helpers
|
|
15
|
-
|
|
15
|
+
const getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
16
16
|
// Get the project directory
|
|
17
|
-
|
|
17
|
+
const root = (0, getRootPath_1.default)();
|
|
18
18
|
// Check for cypress folder
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const cypressDir = path_1.default.join(root, 'cypress');
|
|
20
|
+
const cypressExists = fs_1.default.existsSync(cypressDir);
|
|
21
21
|
if (!cypressExists) {
|
|
22
22
|
console.log('(!) Install Cypress First (!)');
|
|
23
23
|
console.log('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../preinstall/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B;;;GAGG;;;;;AAEH,cAAc;AACd,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../preinstall/index.ts"],"names":[],"mappings":";AAAA,+BAA+B;AAC/B;;;GAGG;;;;;AAEH,cAAc;AACd,4CAAoB;AACpB,gDAAwB;AAExB,iBAAiB;AACjB,wEAAgD;AAEhD,4BAA4B;AAC5B,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;AAE3B,2BAA2B;AAC3B,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC9C,MAAM,aAAa,GAAG,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAChD,IAAI,CAAC,aAAa,EAAE,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -4,31 +4,31 @@ 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
|
-
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
10
10
|
/**
|
|
11
11
|
* Ensure gitignore includes the necessary entries for Cypress results
|
|
12
12
|
* @author Yuen Ler Chow
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const addToGitIgnore = () => {
|
|
15
|
+
const root = (0, getRootPath_1.default)();
|
|
16
|
+
const gitignorePath = path_1.default.join(root, '.gitignore');
|
|
17
|
+
const entries = [
|
|
18
18
|
'cypress-results/',
|
|
19
19
|
'cypress/downloads',
|
|
20
20
|
'cypress/screenshots',
|
|
21
21
|
'cypress/videos',
|
|
22
22
|
'cypress/globals/GlobalCredentials.ts',
|
|
23
23
|
];
|
|
24
|
-
|
|
24
|
+
let gitignoreContent = '';
|
|
25
25
|
if ((0, fs_1.existsSync)(gitignorePath)) {
|
|
26
26
|
gitignoreContent = (0, fs_1.readFileSync)(gitignorePath, 'utf8');
|
|
27
27
|
}
|
|
28
28
|
// Check which entries are missing
|
|
29
|
-
|
|
29
|
+
const missingEntries = entries.filter((entry) => {
|
|
30
30
|
// Check if entry exists (with or without newline)
|
|
31
|
-
|
|
31
|
+
const regex = new RegExp(`^${entry.replace(/\//g, '\\/')}$`, 'm');
|
|
32
32
|
return !regex.test(gitignoreContent);
|
|
33
33
|
});
|
|
34
34
|
// Add missing entries
|
|
@@ -37,11 +37,11 @@ var addToGitIgnore = function () {
|
|
|
37
37
|
gitignoreContent += '\n';
|
|
38
38
|
}
|
|
39
39
|
gitignoreContent += '\n# Cypress parallel test results (added by dceky)\n';
|
|
40
|
-
missingEntries.forEach(
|
|
41
|
-
gitignoreContent +=
|
|
40
|
+
missingEntries.forEach((entry) => {
|
|
41
|
+
gitignoreContent += `${entry}\n`;
|
|
42
42
|
});
|
|
43
43
|
(0, fs_1.writeFileSync)(gitignorePath, gitignoreContent, 'utf8');
|
|
44
|
-
console.log(
|
|
44
|
+
console.log(`Added ${missingEntries.length} entries to .gitignore`);
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
exports.default = addToGitIgnore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addToGitIgnore.js","sourceRoot":"","sources":["../../setup/addToGitIgnore.ts"],"names":[],"mapp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,KAAK,EAAE,EAAE;YAC/B,gBAAgB,IAAI,GAAG,KAAK,IAAI,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAA,kBAAa,EAAC,aAAa,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,SAAS,cAAc,CAAC,MAAM,wBAAwB,CAAC,CAAC;IACtE,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -3,34 +3,34 @@ 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
|
// Import shared helpers
|
|
9
|
-
|
|
9
|
+
const getRootPath_1 = __importDefault(require("../helpers/getRootPath"));
|
|
10
10
|
/**
|
|
11
11
|
* Generate an empty [Name].ts file at /cypress/globals/[Name].ts
|
|
12
12
|
* @author Gabe Abrams
|
|
13
13
|
* @param name Name of the global file to create (without extension)
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const genEmptyGlobalFile = (name) => {
|
|
16
|
+
const root = (0, getRootPath_1.default)();
|
|
17
17
|
// Log the action
|
|
18
18
|
// eslint-disable-next-line no-console
|
|
19
|
-
console.log(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
console.log(`Adding missing globals file: Global${name}.ts`);
|
|
20
|
+
const globalsDir = path_1.default.join(root, 'cypress/globals');
|
|
21
|
+
const outputFile = path_1.default.join(globalsDir, `Global${name}.ts`);
|
|
22
22
|
// Check if the directory exists
|
|
23
23
|
if (!fs_1.default.existsSync(globalsDir)) {
|
|
24
24
|
// Create the directory
|
|
25
25
|
fs_1.default.mkdirSync(globalsDir, { recursive: true });
|
|
26
26
|
}
|
|
27
27
|
// Create an empty file with a comment
|
|
28
|
-
|
|
28
|
+
const fileContents = [
|
|
29
29
|
'/**',
|
|
30
|
-
|
|
30
|
+
` * Global ${name}`,
|
|
31
31
|
' */',
|
|
32
32
|
'',
|
|
33
|
-
|
|
33
|
+
`const Global${name} = {`,
|
|
34
34
|
' // Static Value Examples:',
|
|
35
35
|
' // baseURL: \'immersive.dcex.harvard.edu\'',
|
|
36
36
|
' // loginSystem: \'HarvardKey\'',
|
|
@@ -50,7 +50,7 @@ var genEmptyGlobalFile = function (name) {
|
|
|
50
50
|
' // },',
|
|
51
51
|
'};',
|
|
52
52
|
'',
|
|
53
|
-
|
|
53
|
+
`export default Global${name};`,
|
|
54
54
|
'',
|
|
55
55
|
];
|
|
56
56
|
fs_1.default.writeFileSync(outputFile, fileContents.join('\n'), 'utf8');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genEmptyGlobalFile.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/genEmptyGlobalFile.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genEmptyGlobalFile.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/genEmptyGlobalFile.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,wBAAwB;AACxB,yEAAiD;AAEjD;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAU,EAAE;IAClD,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,iBAAiB;IACjB,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,sCAAsC,IAAI,KAAK,CAAC,CAAC;IAE7D,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,IAAI,KAAK,CAAC,CAAC;IAE7D,gCAAgC;IAChC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,uBAAuB;QACvB,YAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,sCAAsC;IACtC,MAAM,YAAY,GAAG;QACnB,KAAK;QACL,aAAa,IAAI,EAAE;QACnB,KAAK;QACL,EAAE;QACF,eAAe,IAAI,MAAM;QACzB,6BAA6B;QAC7B,8CAA8C;QAC9C,kCAAkC;QAClC,EAAE;QACF,+BAA+B;QAC/B,mBAAmB;QACnB,oCAAoC;QACpC,2CAA2C;QAC3C,sDAAsD;QACtD,SAAS;QACT,EAAE;QACF,4CAA4C;QAC5C,iBAAiB;QACjB,gCAAgC;QAChC,0CAA0C;QAC1C,mEAAmE;QACnE,SAAS;QACT,IAAI;QACJ,EAAE;QACF,wBAAwB,IAAI,GAAG;QAC/B,EAAE;KACH,CAAC;IACF,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAE9D,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
|
|
@@ -3,34 +3,34 @@ 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
|
// Import shared helpers
|
|
9
|
-
|
|
9
|
+
const getRootPath_1 = __importDefault(require("../helpers/getRootPath"));
|
|
10
10
|
/**
|
|
11
11
|
* Generate an empty [Name].ts file at /cypress/profiles/[Name].Profile.ts
|
|
12
12
|
* @author Gabe Abrams
|
|
13
13
|
* @param name Name of the global file to create (without extension)
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const genEmptyProfileFile = (name) => {
|
|
16
|
+
const root = (0, getRootPath_1.default)();
|
|
17
17
|
// Log the action
|
|
18
18
|
// eslint-disable-next-line no-console
|
|
19
|
-
console.log(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
console.log(`Adding missing profile file: ${name}.Profile.ts`);
|
|
20
|
+
const profilesDir = path_1.default.join(root, 'cypress/profiles');
|
|
21
|
+
const outputFile = path_1.default.join(profilesDir, `${name}.Profile.ts`);
|
|
22
22
|
// Check if the directory exists
|
|
23
23
|
if (!fs_1.default.existsSync(profilesDir)) {
|
|
24
24
|
// Create the directory
|
|
25
25
|
fs_1.default.mkdirSync(profilesDir, { recursive: true });
|
|
26
26
|
}
|
|
27
27
|
// Create an empty file with a comment
|
|
28
|
-
|
|
28
|
+
const fileContents = [
|
|
29
29
|
'/**',
|
|
30
|
-
|
|
30
|
+
` * ${name} Profile`,
|
|
31
31
|
' */',
|
|
32
32
|
'',
|
|
33
|
-
|
|
33
|
+
`const ${name}Profile = {`,
|
|
34
34
|
' // Static Value Examples:',
|
|
35
35
|
' // baseURL: \'immersive.dcex.harvard.edu\'',
|
|
36
36
|
' // loginSystem: \'HarvardKey\'',
|
|
@@ -50,7 +50,7 @@ var genEmptyProfileFile = function (name) {
|
|
|
50
50
|
' // },',
|
|
51
51
|
'};',
|
|
52
52
|
'',
|
|
53
|
-
|
|
53
|
+
`export default ${name}Profile;`,
|
|
54
54
|
'',
|
|
55
55
|
];
|
|
56
56
|
fs_1.default.writeFileSync(outputFile, fileContents.join('\n'), 'utf8');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genEmptyProfileFile.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/genEmptyProfileFile.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genEmptyProfileFile.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/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C,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -3,10 +3,10 @@ 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
|
// Import shared helpers
|
|
9
|
-
|
|
9
|
+
const getRootPath_1 = __importDefault(require("../helpers/getRootPath"));
|
|
10
10
|
/**
|
|
11
11
|
* Generate an example test file at /cypress/e2e/example.cy.ts
|
|
12
12
|
* Does not create test file if e2e folder already exists
|
|
@@ -14,10 +14,10 @@ var getRootPath_1 = __importDefault(require("../helpers/getRootPath"));
|
|
|
14
14
|
* @author Yuen Ler Chow
|
|
15
15
|
* @author Allison Zhang
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const genExampleTest = () => {
|
|
18
|
+
const root = (0, getRootPath_1.default)();
|
|
19
|
+
const e2eDir = path_1.default.join(root, 'cypress/e2e');
|
|
20
|
+
const outputFile = path_1.default.join(e2eDir, 'example.cy.ts');
|
|
21
21
|
// Check if the directory exists
|
|
22
22
|
if (!fs_1.default.existsSync(e2eDir)) {
|
|
23
23
|
// Create the directory
|
|
@@ -30,7 +30,7 @@ var genExampleTest = function () {
|
|
|
30
30
|
// eslint-disable-next-line no-console
|
|
31
31
|
console.log('Adding example test file: e2e/example.cy.ts');
|
|
32
32
|
// Create an empty file with a comment
|
|
33
|
-
|
|
33
|
+
const fileContents = [
|
|
34
34
|
'describe(\'Example Test Suite\', () => {',
|
|
35
35
|
' it(\'Should fill out form\', () => {',
|
|
36
36
|
' cy.visit(\'https://formy-project.herokuapp.com/form\');',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genExampleTest.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/genExampleTest.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genExampleTest.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/genExampleTest.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,wBAAwB;AACxB,yEAAiD;AAEjD;;;;;;GAMG;AACH,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAEtD,gCAAgC;IAChC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,uBAAuB;QACvB,YAAE,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;SAAM,CAAC;QACN,OAAO;IACT,CAAC;IAED,iBAAiB;IACjB,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC;IAE3D,sCAAsC;IACtC,MAAM,YAAY,GAAG;QACnB,0CAA0C;QAC1C,wCAAwC;QACxC,6DAA6D;QAC7D,6DAA6D;QAC7D,kCAAkC;QAClC,OAAO;QACP,KAAK;QACL,EAAE;KACH,CAAC;IACF,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -4,49 +4,49 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
// Import libs
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
9
|
// Import shared helpers
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const getRootPath_1 = __importDefault(require("../helpers/getRootPath"));
|
|
11
|
+
const genEmptyGlobalFile_1 = __importDefault(require("./genEmptyGlobalFile"));
|
|
12
|
+
const genEmptyProfileFile_1 = __importDefault(require("./genEmptyProfileFile"));
|
|
13
|
+
const genExampleTest_1 = __importDefault(require("./genExampleTest"));
|
|
14
14
|
/**
|
|
15
15
|
* Ensure required configuration files exist in the consumer repo
|
|
16
16
|
* @author Yuen Ler Chow
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const checkRequiredFiles = () => {
|
|
19
|
+
const root = (0, getRootPath_1.default)();
|
|
20
|
+
const globalsPath = path_1.default.join(root, 'cypress/globals');
|
|
21
|
+
const profilesPath = path_1.default.join(root, 'cypress/profiles');
|
|
22
22
|
// Required global files
|
|
23
|
-
|
|
23
|
+
const requiredGlobals = [
|
|
24
24
|
'Credentials',
|
|
25
25
|
'Resources',
|
|
26
26
|
'Values',
|
|
27
27
|
];
|
|
28
28
|
// Determine profile file name (default is stage)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const profileName = process.env.CYPRESS_PROFILE || 'Stage';
|
|
30
|
+
const defaultProfileName = 'Default';
|
|
31
|
+
const requiredProfile = `${profileName}.Profile.ts`;
|
|
32
32
|
// Check global files
|
|
33
|
-
requiredGlobals.forEach(
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
requiredGlobals.forEach((globalName) => {
|
|
34
|
+
const filePath = path_1.default.join(globalsPath, `Global${globalName}.ts`);
|
|
35
|
+
const found = (0, fs_1.existsSync)(filePath);
|
|
36
36
|
if (!found) {
|
|
37
37
|
// Create the file
|
|
38
38
|
(0, genEmptyGlobalFile_1.default)(globalName);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
// Check profile file
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const profileFilePath = path_1.default.join(profilesPath, requiredProfile);
|
|
43
|
+
const profileFound = (0, fs_1.existsSync)(profileFilePath);
|
|
44
44
|
if (!profileFound) {
|
|
45
45
|
(0, genEmptyProfileFile_1.default)(profileName);
|
|
46
46
|
}
|
|
47
47
|
// Check default profile file
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const defaultProfileFilePath = path_1.default.join(profilesPath, `${defaultProfileName}.Profile.ts`);
|
|
49
|
+
const defaultProfileFound = (0, fs_1.existsSync)(defaultProfileFilePath);
|
|
50
50
|
if (!defaultProfileFound) {
|
|
51
51
|
(0, genEmptyProfileFile_1.default)(defaultProfileName);
|
|
52
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/index.ts"],"names":[],"mappings":";;;;;AAAA,cAAc;AACd,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/index.ts"],"names":[],"mappings":";;;;;AAAA,cAAc;AACd,2BAAgC;AAChC,gDAAwB;AAExB,wBAAwB;AACxB,yEAAiD;AACjD,8EAAsD;AACtD,gFAAwD;AACxD,sEAA8C;AAE9C;;;GAGG;AACH,MAAM,kBAAkB,GAAG,GAAS,EAAE;IACpC,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACvD,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAEzD,wBAAwB;IACxB,MAAM,eAAe,GAAG;QACtB,aAAa;QACb,WAAW;QACX,QAAQ;KACT,CAAC;IAEF,iDAAiD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
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
9
9
|
/**
|
|
10
10
|
* Generate an index.ts file that imports and runs all command files in cypress/commands
|
|
11
11
|
* This should be called from cypress.config.js
|
|
12
12
|
* @author Yuen Ler Chow
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const genCommandImportFile = () => {
|
|
15
|
+
const root = (0, getRootPath_1.default)();
|
|
16
16
|
// Delete old commands.js file
|
|
17
|
-
|
|
17
|
+
const oldJsFile = path_1.default.join(root, 'cypress/support/commands.js');
|
|
18
18
|
if (fs_1.default.existsSync(oldJsFile)) {
|
|
19
19
|
fs_1.default.unlinkSync(oldJsFile);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const cypressCommandsDir = path_1.default.join(root, 'cypress/commands');
|
|
22
|
+
const outputFile = path_1.default.join(cypressCommandsDir, 'index.ts');
|
|
23
|
+
const topOfFileComment = '// Auto-generated by dceky - do not edit manually';
|
|
24
24
|
// Check if the directory exists
|
|
25
25
|
if (!fs_1.default.existsSync(cypressCommandsDir)) {
|
|
26
26
|
// Create the directory
|
|
27
27
|
fs_1.default.mkdirSync(cypressCommandsDir, { recursive: true });
|
|
28
28
|
// Create an empty file so init doesn't fail
|
|
29
|
-
fs_1.default.writeFileSync(outputFile,
|
|
29
|
+
fs_1.default.writeFileSync(outputFile, `${topOfFileComment}\n`);
|
|
30
30
|
return outputFile;
|
|
31
31
|
}
|
|
32
32
|
// Get all files in the directory
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const files = fs_1.default.readdirSync(cypressCommandsDir);
|
|
34
|
+
const commandFiles = [];
|
|
35
35
|
// Filter out non-JS/TS files and process each file
|
|
36
|
-
files.forEach(
|
|
36
|
+
files.forEach((file) => {
|
|
37
37
|
// Skip non-JS/TS files (like .d.ts, .map, etc.)
|
|
38
38
|
if (!file.endsWith('.js') && !file.endsWith('.ts')) {
|
|
39
39
|
return;
|
|
@@ -43,9 +43,9 @@ var genCommandImportFile = function () {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
// Determine the file's path
|
|
46
|
-
|
|
46
|
+
const filePath = path_1.default.join(cypressCommandsDir, file);
|
|
47
47
|
// Check if it's a file (not a directory)
|
|
48
|
-
|
|
48
|
+
const stats = fs_1.default.statSync(filePath);
|
|
49
49
|
if (!stats.isFile()) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
@@ -53,18 +53,18 @@ var genCommandImportFile = function () {
|
|
|
53
53
|
commandFiles.push(file);
|
|
54
54
|
});
|
|
55
55
|
// Generate require statements and function calls
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
commandFiles.forEach(
|
|
59
|
-
|
|
56
|
+
const requires = [];
|
|
57
|
+
const calls = [];
|
|
58
|
+
commandFiles.forEach((file) => {
|
|
59
|
+
const requirePath = `./${file}`;
|
|
60
60
|
// Create a safe variable name (replace non-alphanumeric with underscore)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
requires.push(
|
|
64
|
-
calls.push(
|
|
61
|
+
const importName = file.replace(/\.(js|ts)$/, '');
|
|
62
|
+
const varName = importName.replace(/[^a-zA-Z0-9]/g, '_');
|
|
63
|
+
requires.push(`const ${varName} = require('${requirePath}');`);
|
|
64
|
+
calls.push(`${varName}.default();`);
|
|
65
65
|
});
|
|
66
66
|
// Build the final content
|
|
67
|
-
|
|
67
|
+
const content = `${topOfFileComment}\n${requires.join('\n')}\n\n${calls.join('\n')}`;
|
|
68
68
|
// Write to the output file
|
|
69
69
|
fs_1.default.writeFileSync(outputFile, content, 'utf8');
|
|
70
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genCommandImportFile.js","sourceRoot":"","sources":["../../setup/genCommandImportFile.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genCommandImportFile.js","sourceRoot":"","sources":["../../setup/genCommandImportFile.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,wEAAgD;AAEhD;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,GAAG,EAAE;IAChC,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,8BAA8B;IAC9B,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;IACjE,IAAI,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IAC7D,MAAM,gBAAgB,GAAG,mDAAmD,CAAC;IAE7E,gCAAgC;IAChC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACvC,uBAAuB;QACvB,YAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,4CAA4C;QAC5C,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,GAAG,gBAAgB,IAAI,CAAC,CAAC;QACtD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,iCAAiC;IACjC,MAAM,KAAK,GAAG,YAAE,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACjD,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,mDAAmD;IACnD,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE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AK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAErF,2BAA2B;IAC3B,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
|
@@ -3,22 +3,22 @@ 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 fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
9
9
|
/**
|
|
10
10
|
* Generate the dynamic configuration file
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const genDynamicConfigFile = () => {
|
|
13
|
+
const root = (0, getRootPath_1.default)();
|
|
14
14
|
// Delete .js version of the config file if it exists
|
|
15
|
-
|
|
15
|
+
const jsConfigPath = path_1.default.join(root, 'cypress.config.js');
|
|
16
16
|
if (fs_1.default.existsSync(jsConfigPath)) {
|
|
17
17
|
fs_1.default.unlinkSync(jsConfigPath);
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
const outputFile = path_1.default.join(root, 'cypress.config.ts');
|
|
20
20
|
// Create the dynamic configuration file
|
|
21
|
-
|
|
21
|
+
const dynamicConfigFile = [
|
|
22
22
|
'// Auto-generated by dceky - do not edit manually',
|
|
23
23
|
'',
|
|
24
24
|
'import genConfiguration from \'dceky/lib/src/genConfiguration\';',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genDynamicConfigFile.js","sourceRoot":"","sources":["../../setup/genDynamicConfigFile.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genDynamicConfigFile.js","sourceRoot":"","sources":["../../setup/genDynamicConfigFile.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,wEAAgD;AAEhD;;GAEG;AACH,MAAM,oBAAoB,GAAG,GAAW,EAAE;IACxC,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,qDAAqD;IACrD,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC1D,IAAI,YAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,YAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAExD,wCAAwC;IACxC,MAAM,iBAAiB,GAAG;QACxB,mDAAmD;QACnD,EAAE;QACF,kEAAkE;QAClE,EAAE;QACF,oCAAoC;QACpC,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,wCAAwC;IACxC,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAExD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,oBAAoB,CAAC"}
|
|
@@ -3,28 +3,28 @@ 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 fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const getRootPath_1 = __importDefault(require("./helpers/getRootPath"));
|
|
9
9
|
/**
|
|
10
10
|
* Generate the launch file for end to end tests
|
|
11
11
|
* @author Gabe Abrams
|
|
12
12
|
* @author Yuen Ler Chow
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const genE2ELaunchFile = () => {
|
|
15
|
+
const root = (0, getRootPath_1.default)();
|
|
16
16
|
// Delete old e2e.js file if it exists
|
|
17
|
-
|
|
17
|
+
const oldJsFile = path_1.default.join(root, '/cypress/support/e2e.js');
|
|
18
18
|
if (fs_1.default.existsSync(oldJsFile)) {
|
|
19
19
|
fs_1.default.unlinkSync(oldJsFile);
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
const outputFile = path_1.default.join(root, '/cypress/support/e2e.ts');
|
|
22
22
|
// Create the dynamic configuration file
|
|
23
|
-
|
|
23
|
+
const launchFile = [
|
|
24
24
|
'// Auto-generated by dceky - do not edit manually',
|
|
25
25
|
'',
|
|
26
26
|
'import commands from \'dceky\';',
|
|
27
|
-
'import \'./kyCommandDeclarations
|
|
27
|
+
'import \'./kyCommandDeclarations\';',
|
|
28
28
|
'import \'../commands\';',
|
|
29
29
|
'',
|
|
30
30
|
'// Make Cypress globally available as "ky"',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genE2ELaunchFile.js","sourceRoot":"","sources":["../../setup/genE2ELaunchFile.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"genE2ELaunchFile.js","sourceRoot":"","sources":["../../setup/genE2ELaunchFile.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,wEAAgD;AAEhD;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,GAAW,EAAE;IACpC,MAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,sCAAsC;IACtC,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;IAC7D,IAAI,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;IAE9D,wCAAwC;IACxC,MAAM,UAAU,GAAG;QACjB,mDAAmD;QACnD,EAAE;QACF,iCAAiC;QACjC,qCAAqC;QACrC,yBAAyB;QACzB,EAAE;QACF,4CAA4C;QAC5C,kBAAkB;QAClB,uBAAuB;QACvB,GAAG;QACH,wBAAwB;QACxB,EAAE;QACF,aAAa;QACb,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,wCAAwC;IACxC,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAEjD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|