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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentDateInfo.js","sourceRoot":"","sources":["../../../src/commands/getCurrentDateInfo.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA0BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"getCurrentDateInfo.js","sourceRoot":"","sources":["../../../src/commands/getCurrentDateInfo.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA0BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC9C,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAOV;YACF,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE;YAC5B,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE;YACxB,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE;YACtB,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;YAC7B,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE;YAC3B,UAAU,EAAE,OAAO,CAAC,YAAY,EAAE;SACnC,CAAC;QACF,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,kBAAkB,CAAC"}
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('getId',
|
|
7
|
+
const getId = () => {
|
|
8
|
+
Cypress.Commands.add('getId', (selector) => {
|
|
9
9
|
return (cy
|
|
10
10
|
.get(selector)
|
|
11
11
|
.invoke('attr', 'id')
|
|
12
|
-
.then(
|
|
12
|
+
.then((attr) => {
|
|
13
13
|
return attr;
|
|
14
14
|
}));
|
|
15
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getId.js","sourceRoot":"","sources":["../../../src/commands/getId.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"getId.js","sourceRoot":"","sources":["../../../src/commands/getId.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,KAAK,GAAG,GAAG,EAAE;IACjB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,QAAgB,EAAE,EAAE;QACjD,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;aACpB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACb,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,KAAK,CAAC"}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('getJSON',
|
|
7
|
+
const getJSON = () => {
|
|
8
|
+
Cypress.Commands.add('getJSON', (url) => {
|
|
9
9
|
return (cy
|
|
10
10
|
.request(url)
|
|
11
11
|
.its('body'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJSON.js","sourceRoot":"","sources":["../../../src/commands/getJSON.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"getJSON.js","sourceRoot":"","sources":["../../../src/commands/getJSON.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,OAAO,GAAG,GAAG,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAW,EAAE,EAAE;QAC9C,OAAO,CACL,EAAE;aACC,OAAO,CAAC,GAAG,CAAC;aACZ,GAAG,CAAC,MAAM,CAAC,CACf,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,OAAO,CAAC"}
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('getNumElements',
|
|
9
|
-
cy.log(
|
|
10
|
-
return cy.get(selector).then(
|
|
7
|
+
const getNumElements = () => {
|
|
8
|
+
Cypress.Commands.add('getNumElements', (selector) => {
|
|
9
|
+
cy.log(`Count elements matching ${selector}`);
|
|
10
|
+
return cy.get(selector).then(($elements) => {
|
|
11
11
|
return Cypress.$($elements).length;
|
|
12
12
|
});
|
|
13
13
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNumElements.js","sourceRoot":"","sources":["../../../src/commands/getNumElements.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"getNumElements.js","sourceRoot":"","sources":["../../../src/commands/getNumElements.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,gBAAgB,EAChB,CACE,QAAgB,EAChB,EAAE;QACF,EAAE,CAAC,GAAG,CAAC,2BAA2B,QAAQ,EAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,SAA8B,EAAE,EAAE;YAC9D,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,cAAc,CAAC"}
|
|
@@ -2,7 +2,8 @@ declare global {
|
|
|
2
2
|
namespace Cypress {
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Get a (non-credential) value from the current profile,
|
|
6
|
+
* GlobalValues, or GlobalResources
|
|
6
7
|
* @author Allison Zhang
|
|
7
8
|
* @param key the key of the environment variable to retrieve
|
|
8
9
|
*/
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
7
|
+
const getProfileValue = () => {
|
|
8
8
|
cy.getProfileValue = Cypress.expose;
|
|
9
9
|
};
|
|
10
10
|
/*----------------------------------------*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProfileValue.js","sourceRoot":"","sources":["../../../src/commands/getProfileValue.ts"],"names":[],"mappings":";AAAA,iCAAiC;;
|
|
1
|
+
{"version":3,"file":"getProfileValue.js","sourceRoot":"","sources":["../../../src/commands/getProfileValue.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,EAAE,CAAC,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;AACtC,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,eAAe,CAAC"}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('getSpecialChars',
|
|
7
|
+
const getSpecialChars = () => {
|
|
8
|
+
Cypress.Commands.add('getSpecialChars', () => {
|
|
9
9
|
return cy.wrap('!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ≤≥≠÷…£¢∞§¶•º');
|
|
10
10
|
});
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSpecialChars.js","sourceRoot":"","sources":["../../../src/commands/getSpecialChars.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAmBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"getSpecialChars.js","sourceRoot":"","sources":["../../../src/commands/getSpecialChars.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAmBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC3C,OAAO,EAAE,CAAC,IAAI,CAAC,uOAAuO,CAAC,CAAC;IAC1P,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,eAAe,CAAC"}
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('getTitle',
|
|
7
|
+
const getTitle = () => {
|
|
8
|
+
Cypress.Commands.add('getTitle', () => {
|
|
9
9
|
return (cy
|
|
10
10
|
.title()
|
|
11
|
-
.then(
|
|
11
|
+
.then((title) => {
|
|
12
12
|
return title;
|
|
13
13
|
}));
|
|
14
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTitle.js","sourceRoot":"","sources":["../../../src/commands/getTitle.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAkBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"getTitle.js","sourceRoot":"","sources":["../../../src/commands/getTitle.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAkBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,QAAQ,GAAG,GAAG,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE;QACpC,OAAO,CACL,EAAE;aACC,KAAK,EAAE;aACP,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YACd,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,31 +4,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('handleHarvardKey',
|
|
7
|
+
const handleHarvardKey = () => {
|
|
8
|
+
Cypress.Commands.add('handleHarvardKey', (name) => {
|
|
9
9
|
cy.log('🔓 Handling HarvardKey authentication via UI');
|
|
10
10
|
// Get user credentials from environment variables
|
|
11
|
-
cy.getCredentialValue(name).then(
|
|
12
|
-
|
|
11
|
+
cy.getCredentialValue(name).then((cred) => {
|
|
12
|
+
const userInfo = cred;
|
|
13
13
|
if (!userInfo) {
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error(`Could not find ${name} in environment variables`);
|
|
15
15
|
}
|
|
16
16
|
// Destructure the user info object
|
|
17
|
-
|
|
17
|
+
const { username, password } = userInfo;
|
|
18
18
|
// Get the Harvard login URL using originWithKaixa with auto-initialized functions
|
|
19
|
-
cy.origin('https://apps.cirrusidentity.com',
|
|
19
|
+
cy.origin('https://apps.cirrusidentity.com', () => {
|
|
20
20
|
Cypress.require('dceky');
|
|
21
21
|
// To go the login screen
|
|
22
22
|
// Clicking the button doesn't work for some reason, so we access the href attribute instead
|
|
23
23
|
return cy.navigateToHref('#idp_1001962798_button');
|
|
24
|
-
}).then(
|
|
24
|
+
}).then((fullUrl) => {
|
|
25
25
|
// Navigate to the Harvard login page using originWithKaixa
|
|
26
26
|
cy.origin('https://harvard.idp.cirrusidentity.com', {
|
|
27
|
-
args: { username
|
|
28
|
-
},
|
|
27
|
+
args: { username, password, fullUrl },
|
|
28
|
+
}, (args) => {
|
|
29
29
|
Cypress.require('dceky');
|
|
30
|
-
|
|
31
|
-
cy.on('uncaught:exception',
|
|
30
|
+
const { username: harvardUsername, password: harvardPassword, fullUrl: harvardLoginUrl, } = args;
|
|
31
|
+
cy.on('uncaught:exception', (e) => {
|
|
32
32
|
// Ignore known HarvardKey errors
|
|
33
33
|
if (!e.message.includes('ready is not defined')) {
|
|
34
34
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleHarvardKey.js","sourceRoot":"","sources":["../../../src/commands/handleHarvardKey.ts"],"names":[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,EACJ,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,eAAe,GACzB,GAAG,IAAI,CAAC;oBAET,EAAE,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAQ,EAAE,EAAE;wBACvC,iCAAiC;wBACjC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;4BAChD,OAAO,IAAI,CAAC;wBACd,CAAC;wBACD,OAAO,KAAK,CAAC;oBACf,CAAC,CAAC,CAAC;oBAEH,+BAA+B;oBAC/B,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;oBAE1B,sCAAsC;oBACtC,EAAE,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;oBACtC,EAAE,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;oBAEtC,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;oBAC1D,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;oBAE1D,kBAAkB;oBAClB,EAAE,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC,KAAK,EAAE,CAAC;gBAC9E,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,gBAAgB,CAAC"}
|
|
@@ -8,29 +8,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
* @param options.isHiddenForm - If true, only input[type=hidden]. If false, all inputs/selects/textareas. Default: true
|
|
9
9
|
* @returns Object with action URL, method (default 'get'), and field name/value pairs
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
const getFormData = (opts) => {
|
|
12
12
|
var _a, _b;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
const { html, formSelector = 'form', isHiddenForm = true, } = opts;
|
|
14
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
15
|
+
const form = doc.querySelector(formSelector);
|
|
16
|
+
const action = (_a = form === null || form === void 0 ? void 0 : form.getAttribute('action')) !== null && _a !== void 0 ? _a : '';
|
|
17
|
+
const method = ((_b = form === null || form === void 0 ? void 0 : form.getAttribute('method')) !== null && _b !== void 0 ? _b : 'GET').toUpperCase();
|
|
18
|
+
const fields = {};
|
|
19
19
|
// Iterate through all input fields in the form and extract the name and value
|
|
20
|
-
|
|
20
|
+
const selector = isHiddenForm
|
|
21
21
|
? 'input[type=hidden]'
|
|
22
22
|
: 'input, select, textarea';
|
|
23
|
-
form === null || form === void 0 ? void 0 : form.querySelectorAll(selector).forEach(
|
|
23
|
+
form === null || form === void 0 ? void 0 : form.querySelectorAll(selector).forEach((input) => {
|
|
24
24
|
var _a;
|
|
25
|
-
|
|
25
|
+
const name = input.getAttribute('name');
|
|
26
26
|
if (name) {
|
|
27
27
|
fields[name] = (_a = input.getAttribute('value')) !== null && _a !== void 0 ? _a : '';
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
return {
|
|
31
|
-
action
|
|
32
|
-
method
|
|
33
|
-
fields
|
|
31
|
+
action,
|
|
32
|
+
method,
|
|
33
|
+
fields,
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
exports.default = getFormData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFormData.js","sourceRoot":"","sources":["../../../../src/commands/helpers/getFormData.ts"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"getFormData.js","sourceRoot":"","sources":["../../../../src/commands/helpers/getFormData.ts"],"names":[],"mappings":";;AAAA;;;;;;;GAOG;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defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
// Import all commands
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
7
|
+
const assertDoesNotHaveClass_1 = __importDefault(require("./assertDoesNotHaveClass"));
|
|
8
|
+
const assertHasClass_1 = __importDefault(require("./assertHasClass"));
|
|
9
|
+
const assertNumElements_1 = __importDefault(require("./assertNumElements"));
|
|
10
|
+
const checkIfElementExists_1 = __importDefault(require("./checkIfElementExists"));
|
|
11
|
+
const extractDataFromClass_1 = __importDefault(require("./extractDataFromClass"));
|
|
12
|
+
const extractDataFromClassByContents_1 = __importDefault(require("./extractDataFromClassByContents"));
|
|
13
|
+
const genTextOfLength_1 = __importDefault(require("./genTextOfLength"));
|
|
14
|
+
const getAttribute_1 = __importDefault(require("./getAttribute"));
|
|
15
|
+
const getClassName_1 = __importDefault(require("./getClassName"));
|
|
16
|
+
const getCurrentDateInfo_1 = __importDefault(require("./getCurrentDateInfo"));
|
|
17
|
+
const getId_1 = __importDefault(require("./getId"));
|
|
18
|
+
const getJSON_1 = __importDefault(require("./getJSON"));
|
|
19
|
+
const getNumElements_1 = __importDefault(require("./getNumElements"));
|
|
20
|
+
const getSpecialChars_1 = __importDefault(require("./getSpecialChars"));
|
|
21
|
+
const getTitle_1 = __importDefault(require("./getTitle"));
|
|
22
|
+
const handleHarvardKey_1 = __importDefault(require("./handleHarvardKey"));
|
|
23
|
+
const launchAs_1 = __importDefault(require("./launchAs"));
|
|
24
|
+
const listSelectLabels_1 = __importDefault(require("./listSelectLabels"));
|
|
25
|
+
const listSelectValues_1 = __importDefault(require("./listSelectValues"));
|
|
26
|
+
const logIntoPorta_1 = __importDefault(require("./logIntoPorta"));
|
|
27
|
+
const navigateToHref_1 = __importDefault(require("./navigateToHref"));
|
|
28
|
+
const padWithZeros_1 = __importDefault(require("./padWithZeros"));
|
|
29
|
+
const runScript_1 = __importDefault(require("./runScript"));
|
|
30
|
+
const tap_1 = __importDefault(require("./tap"));
|
|
31
|
+
const tapInIFrame_1 = __importDefault(require("./tapInIFrame"));
|
|
32
|
+
const typeInto_1 = __importDefault(require("./typeInto"));
|
|
33
|
+
const uniquify_1 = __importDefault(require("./uniquify"));
|
|
34
|
+
const visitCanvasEndpoint_1 = __importDefault(require("./visitCanvasEndpoint"));
|
|
35
|
+
const waitForAtLeastOneElementPresent_1 = __importDefault(require("./waitForAtLeastOneElementPresent"));
|
|
36
|
+
const waitForElementVisible_1 = __importDefault(require("./waitForElementVisible"));
|
|
37
|
+
const getProfileValue_1 = __importDefault(require("./getProfileValue"));
|
|
38
|
+
const getCredentialValue_1 = __importDefault(require("./getCredentialValue"));
|
|
39
|
+
const getCredentialValues_1 = __importDefault(require("./getCredentialValues"));
|
|
40
40
|
/**
|
|
41
41
|
* Initialize custom commands
|
|
42
42
|
* @author Gabe Abrams
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
const commands = () => {
|
|
45
45
|
// Execute each command adder
|
|
46
46
|
(0, assertDoesNotHaveClass_1.default)();
|
|
47
47
|
(0, assertHasClass_1.default)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":";;;;;AAAA,sBAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":";;;;;AAAA,sBAAsB;AAC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AY,GAAE,CAAC;IACf,IAAA,mBAAS,GAAE,CAAC;IACZ,IAAA,aAAG,GAAE,CAAC;IACN,IAAA,qBAAW,GAAE,CAAC;IACd,IAAA,kBAAQ,GAAE,CAAC;IACX,IAAA,kBAAQ,GAAE,CAAC;IACX,IAAA,6BAAmB,GAAE,CAAC;IACtB,IAAA,yCAA+B,GAAE,CAAC;IAClC,IAAA,+BAAqB,GAAE,CAAC;IACxB,IAAA,yBAAe,GAAE,CAAC;IAClB,IAAA,4BAAkB,GAAE,CAAC;IACrB,IAAA,6BAAmB,GAAE,CAAC;AACxB,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,20 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
7
|
+
const getFormData_1 = __importDefault(require("./helpers/getFormData"));
|
|
8
8
|
/*----------------------------------------*/
|
|
9
9
|
/* --------------- Command -------------- */
|
|
10
10
|
/*----------------------------------------*/
|
|
11
|
-
|
|
12
|
-
Cypress.Commands.add('launchAs',
|
|
13
|
-
if (opts === void 0) { opts = {}; }
|
|
11
|
+
const launchAs = () => {
|
|
12
|
+
Cypress.Commands.add('launchAs', (name, opts = {}) => {
|
|
14
13
|
// Log the action
|
|
15
|
-
cy.log(
|
|
14
|
+
cy.log(`🚀 Launch as ${name}`);
|
|
16
15
|
// Destructure opts
|
|
17
|
-
|
|
16
|
+
let { courseId, appName } = opts;
|
|
18
17
|
// Get courseId from environment variables if not provided
|
|
19
18
|
if (!courseId) {
|
|
20
|
-
|
|
19
|
+
const envCourseId = cy.getProfileValue('courseId');
|
|
21
20
|
if (!envCourseId) {
|
|
22
21
|
throw new Error('Could not find courseId in environment variables');
|
|
23
22
|
}
|
|
@@ -29,30 +28,30 @@ var launchAs = function () {
|
|
|
29
28
|
throw new Error('Could not find appName in environment variables');
|
|
30
29
|
}
|
|
31
30
|
// Get user accessToken from environment variables
|
|
32
|
-
cy.getCredentialValue(name).then(
|
|
33
|
-
|
|
31
|
+
cy.getCredentialValue(name).then((cred) => {
|
|
32
|
+
const userInfo = cred;
|
|
34
33
|
if (!userInfo) {
|
|
35
|
-
throw new Error(
|
|
34
|
+
throw new Error(`Could not find ${name} in environment variables`);
|
|
36
35
|
}
|
|
37
|
-
|
|
36
|
+
const { accessToken } = userInfo;
|
|
38
37
|
if (!accessToken) {
|
|
39
|
-
throw new Error(
|
|
38
|
+
throw new Error(`Could not find accessToken for ${name} in environment variables`);
|
|
40
39
|
}
|
|
41
40
|
// List external tools in the course
|
|
42
41
|
return (cy
|
|
43
42
|
.request({
|
|
44
43
|
method: 'GET',
|
|
45
|
-
url:
|
|
44
|
+
url: `https://canvas.harvard.edu/api/v1/courses/${courseId}/external_tools`,
|
|
46
45
|
body: {
|
|
47
46
|
access_token: accessToken,
|
|
48
47
|
per_page: 100,
|
|
49
48
|
},
|
|
50
49
|
})
|
|
51
|
-
.then(
|
|
50
|
+
.then((response) => {
|
|
52
51
|
// Extract tools from the body
|
|
53
|
-
|
|
52
|
+
const externalTools = response.body;
|
|
54
53
|
// Find the external tool of interest
|
|
55
|
-
|
|
54
|
+
const matchingTool = externalTools.find((externalTool) => {
|
|
56
55
|
// Skip non-nav items
|
|
57
56
|
if (
|
|
58
57
|
// No nav
|
|
@@ -66,7 +65,7 @@ var launchAs = function () {
|
|
|
66
65
|
return false;
|
|
67
66
|
}
|
|
68
67
|
// Skip if the app name does not match the expected name
|
|
69
|
-
|
|
68
|
+
const thisAppName = (externalTool
|
|
70
69
|
.course_navigation
|
|
71
70
|
.text
|
|
72
71
|
.trim()
|
|
@@ -75,26 +74,26 @@ var launchAs = function () {
|
|
|
75
74
|
});
|
|
76
75
|
// Make sure we found the app
|
|
77
76
|
if (!matchingTool) {
|
|
78
|
-
throw new Error(
|
|
77
|
+
throw new Error(`Could not find any apps named "${appName}" in course ${courseId}`);
|
|
79
78
|
}
|
|
80
79
|
// Get the toolId for the matching tool
|
|
81
|
-
|
|
80
|
+
const toolId = (matchingTool === null || matchingTool === void 0 ? void 0 : matchingTool.id) || 0;
|
|
82
81
|
return cy.wrap(toolId);
|
|
83
82
|
})
|
|
84
|
-
.then(
|
|
83
|
+
.then((toolId) => {
|
|
85
84
|
// Request sessionless launch URL
|
|
86
85
|
return (cy
|
|
87
86
|
.request({
|
|
88
87
|
method: 'GET',
|
|
89
|
-
url:
|
|
88
|
+
url: `https://canvas.harvard.edu/api/v1/courses/${courseId}/external_tools/sessionless_launch?id=${toolId}`,
|
|
90
89
|
body: {
|
|
91
90
|
access_token: accessToken,
|
|
92
91
|
},
|
|
93
92
|
})
|
|
94
93
|
.its('body'));
|
|
95
94
|
})
|
|
96
|
-
.then(
|
|
97
|
-
cy.on('uncaught:exception',
|
|
95
|
+
.then((sessionlessLaunchInfo) => {
|
|
96
|
+
cy.on('uncaught:exception', (e) => {
|
|
98
97
|
// Ignore known LTI launch errors
|
|
99
98
|
if (!e.message.includes('postMessage')) {
|
|
100
99
|
return true;
|
|
@@ -102,9 +101,9 @@ var launchAs = function () {
|
|
|
102
101
|
return false;
|
|
103
102
|
});
|
|
104
103
|
// Launch via the sessionless launch URL
|
|
105
|
-
|
|
106
|
-
cy.request(launchURL).then(
|
|
107
|
-
|
|
104
|
+
const launchURL = sessionlessLaunchInfo.url;
|
|
105
|
+
cy.request(launchURL).then((response) => {
|
|
106
|
+
const { action, fields } = (0, getFormData_1.default)({ html: response.body });
|
|
108
107
|
cy.visit({
|
|
109
108
|
url: action,
|
|
110
109
|
method: 'POST',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchAs.js","sourceRoot":"","sources":["../../../src/commands/launchAs.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;;;AAEjC,
|
|
1
|
+
{"version":3,"file":"launchAs.js","sourceRoot":"","sources":["../../../src/commands/launchAs.ts"],"names":[],"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C;AAE5C,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('listSelectLabels',
|
|
9
|
-
|
|
7
|
+
const listSelectLabels = () => {
|
|
8
|
+
Cypress.Commands.add('listSelectLabels', (selector) => {
|
|
9
|
+
const labels = [];
|
|
10
10
|
return (cy
|
|
11
|
-
.get(
|
|
12
|
-
.each(
|
|
11
|
+
.get(`${selector} option`)
|
|
12
|
+
.each((option) => {
|
|
13
13
|
labels.push(option.attr('label') || option.text());
|
|
14
14
|
})
|
|
15
|
-
.then(
|
|
15
|
+
.then(() => {
|
|
16
16
|
return labels;
|
|
17
17
|
}));
|
|
18
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listSelectLabels.js","sourceRoot":"","sources":["../../../src/commands/listSelectLabels.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"listSelectLabels.js","sourceRoot":"","sources":["../../../src/commands/listSelectLabels.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC,QAAgB,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,OAAO,CACL,EAAE;aACC,GAAG,CAAC,GAAG,QAAQ,SAAS,CAAC;aACzB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,EAAE;YACT,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,gBAAgB,CAAC"}
|
|
@@ -4,18 +4,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
/*----------------------------------------*/
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
|
-
|
|
8
|
-
Cypress.Commands.add('listSelectValues',
|
|
9
|
-
|
|
7
|
+
const listSelectValues = () => {
|
|
8
|
+
Cypress.Commands.add('listSelectValues', (selector) => {
|
|
9
|
+
const vals = [];
|
|
10
10
|
return (cy
|
|
11
|
-
.get(
|
|
12
|
-
.each(
|
|
11
|
+
.get(`${selector} option`)
|
|
12
|
+
.each((option) => {
|
|
13
13
|
cy.wrap(option).invoke('attr', 'value')
|
|
14
|
-
.then(
|
|
14
|
+
.then((value) => {
|
|
15
15
|
vals.push(value || option.text());
|
|
16
16
|
});
|
|
17
17
|
})
|
|
18
|
-
.then(
|
|
18
|
+
.then(() => {
|
|
19
19
|
return vals;
|
|
20
20
|
}));
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listSelectValues.js","sourceRoot":"","sources":["../../../src/commands/listSelectValues.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"listSelectValues.js","sourceRoot":"","sources":["../../../src/commands/listSelectValues.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC,QAAgB,EAAE,EAAE;QAC5D,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,OAAO,CACL,EAAE;aACC,GAAG,CAAC,GAAG,QAAQ,SAAS,CAAC;aACzB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;iBACpC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;gBACd,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,EAAE;YACT,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,gBAAgB,CAAC"}
|