dceky 1.0.23 → 1.0.24
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/cypress/e2e/profile-test.cy.ts +1 -1
- package/lib/src/commands/handleHarvardKey.js +36 -33
- package/lib/src/commands/handleHarvardKey.js.map +1 -1
- package/lib/src/commands/launchAs.js +70 -68
- package/lib/src/commands/launchAs.js.map +1 -1
- package/lib/src/commands/logIntoPorta.js +46 -43
- package/lib/src/commands/logIntoPorta.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/handleHarvardKey.ts +41 -38
- package/src/commands/launchAs.ts +90 -88
- package/src/commands/logIntoPorta.ts +61 -57
- package/lib/commands/assertDoesNotHaveClass.d.ts +0 -18
- package/lib/commands/assertDoesNotHaveClass.js +0 -17
- package/lib/commands/assertDoesNotHaveClass.js.map +0 -1
- package/lib/commands/assertHasClass.d.ts +0 -18
- package/lib/commands/assertHasClass.js +0 -17
- package/lib/commands/assertHasClass.js.map +0 -1
- package/lib/commands/assertNumElements.d.ts +0 -18
- package/lib/commands/assertNumElements.js +0 -17
- package/lib/commands/assertNumElements.js.map +0 -1
- package/lib/commands/clickWithRetry.d.ts +0 -19
- package/lib/commands/clickWithRetry.js +0 -29
- package/lib/commands/clickWithRetry.js.map +0 -1
- package/lib/commands/genTextOfLength.d.ts +0 -20
- package/lib/commands/genTextOfLength.js +0 -20
- package/lib/commands/genTextOfLength.js.map +0 -1
- package/lib/commands/getAttribute.d.ts +0 -20
- package/lib/commands/getAttribute.js +0 -22
- package/lib/commands/getAttribute.js.map +0 -1
- package/lib/commands/getClassName.d.ts +0 -15
- package/lib/commands/getClassName.js +0 -21
- package/lib/commands/getClassName.js.map +0 -1
- package/lib/commands/getCurrentDateInfo.d.ts +0 -21
- package/lib/commands/getCurrentDateInfo.js +0 -25
- package/lib/commands/getCurrentDateInfo.js.map +0 -1
- package/lib/commands/getId.d.ts +0 -15
- package/lib/commands/getId.js +0 -21
- package/lib/commands/getId.js.map +0 -1
- package/lib/commands/getNumElements.d.ts +0 -14
- package/lib/commands/getNumElements.js +0 -19
- package/lib/commands/getNumElements.js.map +0 -1
- package/lib/commands/getSpecialChars.d.ts +0 -14
- package/lib/commands/getSpecialChars.js +0 -16
- package/lib/commands/getSpecialChars.js.map +0 -1
- package/lib/commands/getTitle.d.ts +0 -13
- package/lib/commands/getTitle.js +0 -20
- package/lib/commands/getTitle.js.map +0 -1
- package/lib/commands/handleHarvardKey.d.ts +0 -18
- package/lib/commands/handleHarvardKey.js +0 -56
- package/lib/commands/handleHarvardKey.js.map +0 -1
- package/lib/commands/handleHarvardKey2.d.ts +0 -14
- package/lib/commands/handleHarvardKey2.js +0 -88
- package/lib/commands/handleHarvardKey2.js.map +0 -1
- package/lib/commands/launchAs.d.ts +0 -20
- package/lib/commands/launchAs.js +0 -60
- package/lib/commands/launchAs.js.map +0 -1
- package/lib/commands/launchLTIUsingToken.d.ts +0 -19
- package/lib/commands/launchLTIUsingToken.js +0 -74
- package/lib/commands/launchLTIUsingToken.js.map +0 -1
- package/lib/commands/listSelectLabels.d.ts +0 -15
- package/lib/commands/listSelectLabels.js +0 -24
- package/lib/commands/listSelectLabels.js.map +0 -1
- package/lib/commands/listSelectValues.d.ts +0 -15
- package/lib/commands/listSelectValues.js +0 -26
- package/lib/commands/listSelectValues.js.map +0 -1
- package/lib/commands/navigateToHref.d.ts +0 -19
- package/lib/commands/navigateToHref.js +0 -23
- package/lib/commands/navigateToHref.js.map +0 -1
- package/lib/commands/padWithZeros.d.ts +0 -20
- package/lib/commands/padWithZeros.js +0 -24
- package/lib/commands/padWithZeros.js.map +0 -1
- package/lib/commands/runScript.d.ts +0 -16
- package/lib/commands/runScript.js +0 -25
- package/lib/commands/runScript.js.map +0 -1
- package/lib/commands/typeInto.d.ts +0 -20
- package/lib/commands/typeInto.js +0 -28
- package/lib/commands/typeInto.js.map +0 -1
- package/lib/commands/uniquify.d.ts +0 -15
- package/lib/commands/uniquify.js +0 -25
- package/lib/commands/uniquify.js.map +0 -1
- package/lib/commands/visitCanvasEndpoint.d.ts +0 -27
- package/lib/commands/visitCanvasEndpoint.js +0 -35
- package/lib/commands/visitCanvasEndpoint.js.map +0 -1
- package/lib/commands/visitCanvasGETEndpoint.d.ts +0 -20
- package/lib/commands/visitCanvasGETEndpoint.js +0 -26
- package/lib/commands/visitCanvasGETEndpoint.js.map +0 -1
- package/lib/commands/waitForAtLeastOneElementPresent.d.ts +0 -23
- package/lib/commands/waitForAtLeastOneElementPresent.js +0 -27
- package/lib/commands/waitForAtLeastOneElementPresent.js.map +0 -1
- package/lib/commands/waitForElementVisible.d.ts +0 -14
- package/lib/commands/waitForElementVisible.js +0 -20
- package/lib/commands/waitForElementVisible.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/init.d.ts +0 -6
- package/lib/init.js +0 -69
- package/lib/init.js.map +0 -1
- package/lib/postinstall/helpers/exec.d.ts +0 -8
- package/lib/postinstall/helpers/exec.js +0 -18
- package/lib/postinstall/helpers/exec.js.map +0 -1
- package/lib/setup/checkRequiredFiles.d.ts +0 -6
- package/lib/setup/checkRequiredFiles.js +0 -60
- package/lib/setup/checkRequiredFiles.js.map +0 -1
- package/lib/setup/genEmptyGlobalFile.d.ts +0 -7
- package/lib/setup/genEmptyGlobalFile.js +0 -41
- package/lib/setup/genEmptyGlobalFile.js.map +0 -1
- package/lib/src/commands/launchLTIUsingToken.d.ts +0 -21
- package/lib/src/commands/launchLTIUsingToken.js +0 -76
- package/lib/src/commands/launchLTIUsingToken.js.map +0 -1
- package/lib/src/commands/visitCanvasGETEndpoint.d.ts +0 -20
- package/lib/src/commands/visitCanvasGETEndpoint.js +0 -26
- package/lib/src/commands/visitCanvasGETEndpoint.js.map +0 -1
- package/lib/src/init.d.ts +0 -6
- package/lib/src/init.js +0 -71
- package/lib/src/init.js.map +0 -1
- package/lib/src/node.d.ts +0 -2
- package/lib/src/node.js +0 -10
- package/lib/src/node.js.map +0 -1
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var getClassName = function () {
|
|
8
|
-
Cypress.Commands.add('getClassName', function (selector) {
|
|
9
|
-
return (cy
|
|
10
|
-
.get(selector)
|
|
11
|
-
.invoke('attr', 'class')
|
|
12
|
-
.then(function (attr) {
|
|
13
|
-
return attr;
|
|
14
|
-
}));
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
/*----------------------------------------*/
|
|
18
|
-
/* --------------- Export --------------- */
|
|
19
|
-
/*----------------------------------------*/
|
|
20
|
-
exports.default = getClassName;
|
|
21
|
-
//# sourceMappingURL=getClassName.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getClassName.js","sourceRoot":"","sources":["../../src/commands/getClassName.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,YAAY,GAAG;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,UAAC,QAAgB;QACpD,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;aACvB,IAAI,CAAC,UAAC,IAAI;YACT,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,YAAY,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Get the current day
|
|
6
|
-
* @author Allison Zhang
|
|
7
|
-
* @returns the current month as a number (1-31)
|
|
8
|
-
*/
|
|
9
|
-
getCurrentDateInfo(): Chainable<{
|
|
10
|
-
minute: number;
|
|
11
|
-
hour: number;
|
|
12
|
-
day: number;
|
|
13
|
-
month: number;
|
|
14
|
-
year: number;
|
|
15
|
-
dateString: string;
|
|
16
|
-
}>;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
declare const getCurrentDateInfo: () => void;
|
|
21
|
-
export default getCurrentDateInfo;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var getCurrentDateInfo = function () {
|
|
8
|
-
Cypress.Commands.add('getCurrentDateInfo', function () {
|
|
9
|
-
var current = new Date();
|
|
10
|
-
var dateInfo = {
|
|
11
|
-
minute: current.getMinutes(),
|
|
12
|
-
hour: current.getHours(),
|
|
13
|
-
day: current.getDate(),
|
|
14
|
-
month: current.getMonth() + 1,
|
|
15
|
-
year: current.getFullYear(),
|
|
16
|
-
dateString: current.toDateString(),
|
|
17
|
-
};
|
|
18
|
-
return cy.wrap(dateInfo);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
/*----------------------------------------*/
|
|
22
|
-
/* --------------- Export --------------- */
|
|
23
|
-
/*----------------------------------------*/
|
|
24
|
-
exports.default = getCurrentDateInfo;
|
|
25
|
-
//# sourceMappingURL=getCurrentDateInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentDateInfo.js","sourceRoot":"","sources":["../../src/commands/getCurrentDateInfo.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA0BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,kBAAkB,GAAG;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,oBAAoB,EAAE;QACzC,IAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;QAC3B,IAAM,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"}
|
package/lib/commands/getId.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Get the id of an element
|
|
6
|
-
* @author Allison Zhang
|
|
7
|
-
* @param selector the CSS selector of the element
|
|
8
|
-
* @returns the id of the element
|
|
9
|
-
*/
|
|
10
|
-
getId(selector: string): Chainable<string>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
declare const getId: () => void;
|
|
15
|
-
export default getId;
|
package/lib/commands/getId.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var getId = function () {
|
|
8
|
-
Cypress.Commands.add('getId', function (selector) {
|
|
9
|
-
return (cy
|
|
10
|
-
.get(selector)
|
|
11
|
-
.invoke('attr', 'id')
|
|
12
|
-
.then(function (attr) {
|
|
13
|
-
return attr;
|
|
14
|
-
}));
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
/*----------------------------------------*/
|
|
18
|
-
/* --------------- Export --------------- */
|
|
19
|
-
/*----------------------------------------*/
|
|
20
|
-
exports.default = getId;
|
|
21
|
-
//# sourceMappingURL=getId.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getId.js","sourceRoot":"","sources":["../../src/commands/getId.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,KAAK,GAAG;IACZ,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,UAAC,QAAgB;QAC7C,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;aACpB,IAAI,CAAC,UAAC,IAAI;YACT,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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Get number of elements
|
|
6
|
-
* @param selector a CSS selector corresponding to the item
|
|
7
|
-
* @returns the number of elements on the page
|
|
8
|
-
*/
|
|
9
|
-
getNumElements(selector: string): Chainable<JQuery<any>>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
declare const getNumElements: () => void;
|
|
14
|
-
export default getNumElements;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var getNumElements = function () {
|
|
8
|
-
Cypress.Commands.add('getNumElements', function (selector) {
|
|
9
|
-
cy.log("Count elements matching ".concat(selector));
|
|
10
|
-
return cy.get(selector).then(function ($elements) {
|
|
11
|
-
return cy.wrap($elements.length);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
/*----------------------------------------*/
|
|
16
|
-
/* --------------- Export --------------- */
|
|
17
|
-
/*----------------------------------------*/
|
|
18
|
-
exports.default = getNumElements;
|
|
19
|
-
//# sourceMappingURL=getNumElements.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNumElements.js","sourceRoot":"","sources":["../../src/commands/getNumElements.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAqBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,cAAc,GAAG;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,gBAAgB,EAChB,UACE,QAAgB;QAElB,EAAE,CAAC,GAAG,CAAC,kCAA2B,QAAQ,CAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAC,SAAc;YAC1C,OAAO,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,cAAc,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Generate all printable special characters for Cypress tests
|
|
6
|
-
* @author Allison Zhang
|
|
7
|
-
* @returns a string containing all special characters
|
|
8
|
-
*/
|
|
9
|
-
getSpecialChars(): Chainable<string>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
declare const getSpecialChars: () => void;
|
|
14
|
-
export default getSpecialChars;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var getSpecialChars = function () {
|
|
8
|
-
Cypress.Commands.add('getSpecialChars', function () {
|
|
9
|
-
return cy.wrap('!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ≤≥≠÷…£¢∞§¶•º');
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
/*----------------------------------------*/
|
|
13
|
-
/* --------------- Export --------------- */
|
|
14
|
-
/*----------------------------------------*/
|
|
15
|
-
exports.default = getSpecialChars;
|
|
16
|
-
//# sourceMappingURL=getSpecialChars.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSpecialChars.js","sourceRoot":"","sources":["../../src/commands/getSpecialChars.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAmBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,eAAe,GAAG;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE;QACtC,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"}
|
package/lib/commands/getTitle.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var getTitle = function () {
|
|
8
|
-
Cypress.Commands.add('getTitle', function () {
|
|
9
|
-
return (cy
|
|
10
|
-
.title()
|
|
11
|
-
.then(function (title) {
|
|
12
|
-
return title;
|
|
13
|
-
}));
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
/*----------------------------------------*/
|
|
17
|
-
/* --------------- Export --------------- */
|
|
18
|
-
/*----------------------------------------*/
|
|
19
|
-
exports.default = getTitle;
|
|
20
|
-
//# sourceMappingURL=getTitle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTitle.js","sourceRoot":"","sources":["../../src/commands/getTitle.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAkBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,QAAQ,GAAG;IACf,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE;QAC7B,OAAO,CACL,EAAE;aACC,KAAK,EAAE;aACP,IAAI,CAAC,UAAC,KAAK;YACV,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Handle a HarvardKey login page for a user
|
|
6
|
-
* @param opts object containing all arguments
|
|
7
|
-
* @param opts.url the URL to visit for HarvardKey authentication
|
|
8
|
-
* @param opts.name the name of the user environment variable
|
|
9
|
-
*/
|
|
10
|
-
handleHarvardKey(opts: {
|
|
11
|
-
url: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}): Chainable<void>;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
declare const handleHarvardKey: () => void;
|
|
18
|
-
export default handleHarvardKey;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var handleHarvardKey = function () {
|
|
8
|
-
Cypress.Commands.add('handleHarvardKey', function (opts) {
|
|
9
|
-
var url = opts.url, name = opts.name;
|
|
10
|
-
cy.log('Handling HarvardKey authentication');
|
|
11
|
-
var userInfo = Cypress.env(name);
|
|
12
|
-
if (userInfo == null) {
|
|
13
|
-
throw new Error("Could not find ".concat(name, " in environment variables"));
|
|
14
|
-
}
|
|
15
|
-
var username = userInfo.username;
|
|
16
|
-
var password = userInfo.password;
|
|
17
|
-
cy.visit(url);
|
|
18
|
-
// Get the Harvard login URL using originWithKaixa with auto-initialized functions
|
|
19
|
-
cy.origin('https://apps.cirrusidentity.com', function () {
|
|
20
|
-
Cypress.require('dceky');
|
|
21
|
-
return cy.navigateToHref({
|
|
22
|
-
item: '#idp_1001962798_button',
|
|
23
|
-
domain: 'https://apps.cirrusidentity.com'
|
|
24
|
-
});
|
|
25
|
-
}).then(function (fullUrl) {
|
|
26
|
-
// Navigate to the Harvard login page using originWithKaixa
|
|
27
|
-
cy.origin('https://harvard.idp.cirrusidentity.com', {
|
|
28
|
-
args: { username: username, password: password, fullUrl: fullUrl }
|
|
29
|
-
}, function (args) {
|
|
30
|
-
Cypress.require('dceky');
|
|
31
|
-
var username = args.username, password = args.password, fullUrl = args.fullUrl;
|
|
32
|
-
cy.on('uncaught:exception', function (e) {
|
|
33
|
-
// Ignore known HarvardKey errors
|
|
34
|
-
if (!e.message.includes('ready is not defined')) {
|
|
35
|
-
throw e;
|
|
36
|
-
}
|
|
37
|
-
return false;
|
|
38
|
-
});
|
|
39
|
-
cy.visit(fullUrl.toString());
|
|
40
|
-
// Wait for and fill in the login form using enhanced functions
|
|
41
|
-
cy.waitForElementVisible('#username');
|
|
42
|
-
cy.waitForElementVisible('#password');
|
|
43
|
-
// Add credentials using enhanced functions
|
|
44
|
-
cy.typeInto({ item: '#username', text: username });
|
|
45
|
-
cy.typeInto({ item: '#password', text: password });
|
|
46
|
-
// Submit the form using clickWithRetry
|
|
47
|
-
cy.clickWithRetry('input[type="submit"], button[type="submit"], .btn-primary');
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
/*----------------------------------------*/
|
|
53
|
-
/* --------------- Export --------------- */
|
|
54
|
-
/*----------------------------------------*/
|
|
55
|
-
exports.default = handleHarvardKey;
|
|
56
|
-
//# sourceMappingURL=handleHarvardKey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleHarvardKey.js","sourceRoot":"","sources":["../../src/commands/handleHarvardKey.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAyBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,gBAAgB,GAAG;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,kBAAkB,EAClB,UACE,IAGC;QAEK,IAAA,G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AAC;oBACD,OAAO,KAAK,CAAC;gBACf,CAAC,CAAC,CAAC;gBAEH,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAE7B,+DAA+D;gBAC/D,EAAE,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;gBACtC,EAAE,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;gBAEtC,2CAA2C;gBAC3C,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACnD,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAEnD,uCAAuC;gBACvC,EAAE,CAAC,cAAc,CAAC,2DAA2D,CAAC,CAAC;YACjF,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,gBAAgB,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Handle a HarvardKey login page for a user (using native Cypress commands only)
|
|
6
|
-
* @param url the URL to visit for HarvardKey authentication
|
|
7
|
-
* @example cy.handleHarvardKey2('https://canvas.harvard.edu/login/saml')
|
|
8
|
-
*/
|
|
9
|
-
handleHarvardKey2(url: string): Chainable<void>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
declare const handleHarvardKey2: () => void;
|
|
14
|
-
export default handleHarvardKey2;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var handleHarvardKey2 = function () {
|
|
8
|
-
Cypress.Commands.add('handleHarvardKey2', function (url) {
|
|
9
|
-
cy.log('Handling HarvardKey authentication (native Cypress only)');
|
|
10
|
-
// Get credentials from environment variables
|
|
11
|
-
var username = Cypress.env('HARVARD_USERNAME');
|
|
12
|
-
var password = Cypress.env('HARVARD_PASSWORD');
|
|
13
|
-
if (!username) {
|
|
14
|
-
throw new Error("HARVARD_USERNAME environment variable is not set");
|
|
15
|
-
}
|
|
16
|
-
if (!password) {
|
|
17
|
-
throw new Error("HARVARD_PASSWORD environment variable is not set");
|
|
18
|
-
}
|
|
19
|
-
cy.log('Starting HarvardKey authentication with credentials check');
|
|
20
|
-
cy.log('Username: ' + (username ? 'SET' : 'NOT SET'));
|
|
21
|
-
cy.log('Password: ' + (password ? 'SET' : 'NOT SET'));
|
|
22
|
-
cy.visit(url);
|
|
23
|
-
// Get the Harvard login URL using native Cypress commands only
|
|
24
|
-
cy.origin('https://apps.cirrusidentity.com', function () {
|
|
25
|
-
// Wait for the Harvard identity provider button and get its href using native Cypress commands only
|
|
26
|
-
cy.visit('https://google.com');
|
|
27
|
-
}).then(function (fullUrl) {
|
|
28
|
-
cy.log('Received full URL from first origin: ' + fullUrl);
|
|
29
|
-
// Navigate to the Harvard login page using native Cypress commands
|
|
30
|
-
cy.origin('https://google.com', {
|
|
31
|
-
args: { fullUrl: fullUrl }
|
|
32
|
-
}, function (_a) {
|
|
33
|
-
var args = _a.args;
|
|
34
|
-
cy.log('Inside second origin - args received:');
|
|
35
|
-
cy.log('args object: ' + JSON.stringify(args));
|
|
36
|
-
if (!args || !args.fullUrl) {
|
|
37
|
-
throw new Error('Args object or fullUrl is undefined');
|
|
38
|
-
}
|
|
39
|
-
// Get credentials from Cypress env instead of args
|
|
40
|
-
var username = Cypress.env('HARVARD_USERNAME');
|
|
41
|
-
var password = Cypress.env('HARVARD_PASSWORD');
|
|
42
|
-
var fullUrl = args.fullUrl;
|
|
43
|
-
cy.log('Full URL: ' + fullUrl);
|
|
44
|
-
cy.log('Username: ' + username);
|
|
45
|
-
cy.log('Password: ' + password);
|
|
46
|
-
// Handle known HarvardKey errors
|
|
47
|
-
cy.on('uncaught:exception', function (e) {
|
|
48
|
-
if (!e.message.includes('ready is not defined')) {
|
|
49
|
-
throw e;
|
|
50
|
-
}
|
|
51
|
-
return false;
|
|
52
|
-
});
|
|
53
|
-
// Visit the Harvard login page
|
|
54
|
-
cy.visit(fullUrl.toString());
|
|
55
|
-
// Wait for and fill in the login form using native Cypress commands
|
|
56
|
-
cy.get('#username', { timeout: 10000 })
|
|
57
|
-
.should('be.visible')
|
|
58
|
-
.clear()
|
|
59
|
-
.type(username);
|
|
60
|
-
cy.get('#password', { timeout: 10000 })
|
|
61
|
-
.should('be.visible')
|
|
62
|
-
.clear()
|
|
63
|
-
.type(password);
|
|
64
|
-
// Submit the form - try multiple possible submit selectors
|
|
65
|
-
cy.get('body').then(function ($body) {
|
|
66
|
-
if ($body.find('input[type="submit"]').length > 0) {
|
|
67
|
-
cy.get('input[type="submit"]').first().click();
|
|
68
|
-
}
|
|
69
|
-
else if ($body.find('button[type="submit"]').length > 0) {
|
|
70
|
-
cy.get('button[type="submit"]').first().click();
|
|
71
|
-
}
|
|
72
|
-
else if ($body.find('.btn-primary').length > 0) {
|
|
73
|
-
cy.get('.btn-primary').first().click();
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
// Fallback - look for any button or submit input
|
|
77
|
-
cy.get('button, input[type="submit"]').first().click();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
/*----------------------------------------*/
|
|
85
|
-
/* --------------- Export --------------- */
|
|
86
|
-
/*----------------------------------------*/
|
|
87
|
-
exports.default = handleHarvardKey2;
|
|
88
|
-
//# sourceMappingURL=handleHarvardK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;AAC5C,4CAA4C;AAE5C,kBAAe,iBAAiB,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Log into Canvas and launch an LTI app as a specific user from environment variables.
|
|
6
|
-
* The user should be defined as an environment variable with the following properties:
|
|
7
|
-
* - accessToken: Canvas access token for the user (required for production mode)
|
|
8
|
-
* - type: User type ('student', 'ta', 'teacher') for local mode (defaults to 'teacher')
|
|
9
|
-
* - simIndex: Simulator index for local mode (defaults to '0')
|
|
10
|
-
* @param name the name of the user environment variable
|
|
11
|
-
* @param opts object containing all arguments
|
|
12
|
-
* @param opts.courseId the Canvas ID of the course to launch from
|
|
13
|
-
* @param opts.appName the name of the app as it appears in the course's left-hand nav
|
|
14
|
-
*/
|
|
15
|
-
launchAs(name: string, courseId?: number, appName?: string): Chainable<void>;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
declare const launchAs: () => void;
|
|
20
|
-
export default launchAs;
|
package/lib/commands/launchAs.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var launchAs = function () {
|
|
8
|
-
Cypress.Commands.add('launchAs', function (name, opts) {
|
|
9
|
-
if (opts === void 0) { opts = {}; }
|
|
10
|
-
var courseId = opts.courseId, appName = opts.appName;
|
|
11
|
-
// Get default values from environment variables if not provided
|
|
12
|
-
if (!courseId) {
|
|
13
|
-
var envCourseId = Cypress.env('COURSE_ID');
|
|
14
|
-
if (!envCourseId) {
|
|
15
|
-
throw new Error('courseId parameter is required or COURSE_ID environment variable must be set');
|
|
16
|
-
}
|
|
17
|
-
courseId = Number.parseInt(envCourseId, 10);
|
|
18
|
-
}
|
|
19
|
-
if (!appName) {
|
|
20
|
-
appName = Cypress.env('APP_NAME');
|
|
21
|
-
if (!appName) {
|
|
22
|
-
throw new Error('appName parameter is required or APP_NAME environment variable must be set');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
// Check if this is a local launch
|
|
26
|
-
var isLocal = Cypress.env('LOCAL') === 'true';
|
|
27
|
-
if (isLocal) {
|
|
28
|
-
// Handle local simulator launch
|
|
29
|
-
var userType = Cypress.env("".concat(name, "_TYPE")) || 'teacher';
|
|
30
|
-
var simIndex = Cypress.env("".concat(name, "_SIM_INDEX")) || '0';
|
|
31
|
-
var simLaunchButtonId = "".concat(userType, "_").concat(simIndex, "-launch-button");
|
|
32
|
-
cy.log('Local mode: launching simulator');
|
|
33
|
-
cy.visit('https://localhost:8088/simulator');
|
|
34
|
-
// Handle potential SSL certificate issues
|
|
35
|
-
cy.get('body').then(function ($body) {
|
|
36
|
-
if ($body.find('.ssl').length > 0) {
|
|
37
|
-
cy.log('Handling SSL certificate issue');
|
|
38
|
-
cy.get('#details-button').click();
|
|
39
|
-
cy.get('#proceed-link').click();
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
// Launch the app
|
|
43
|
-
cy.get("#".concat(simLaunchButtonId)).click();
|
|
44
|
-
cy.get('.authorize-button', { timeout: 1000 }).click();
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
// Handle production launch with access token
|
|
48
|
-
var accessToken = Cypress.env("".concat(name, "_ACCESS_TOKEN"));
|
|
49
|
-
if (!accessToken) {
|
|
50
|
-
throw new Error("".concat(name, "_ACCESS_TOKEN environment variable is required for user \"").concat(name, "\""));
|
|
51
|
-
}
|
|
52
|
-
// Launch using the access token
|
|
53
|
-
cy.launchLTIUsingToken(accessToken, courseId, appName);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
/*----------------------------------------*/
|
|
57
|
-
/* --------------- Export --------------- */
|
|
58
|
-
/*----------------------------------------*/
|
|
59
|
-
exports.default = launchAs;
|
|
60
|
-
//# sourceMappingURL=launchAs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"launchAs.js","sourceRoot":"","sources":["../../src/commands/launchAs.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA+BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,QAAQ,GAAG;IACf,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,UAAU,EACV,UACE,IAAY,EACZ,IAGM;QAHN,qBAAA,EAAA,SAGM;QAEF,IAAA,QAAQ,GAAc,IAAI,SAAlB,EAAE,OAAO,GAAK,IAAI,QAAT,CAAU;QAEjC,gEAAgE;QAChE,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC5C,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACtE,CAAC;YACD,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC9C,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACjC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,IAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,yBAAkB,IAAI,8BAA2B,CAAC,CAAC;QACrE,CAAC;QAED,EAAE,CAAC,GAAG,CAAC,iCAAgB,IAAI,CAAE,CAAC,CAAC;QAE/B,kCAAkC;QAClC,I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ChC,EAAE,CAAC,mBAAmB,CAAC,WAAW,EAAE,EAAE,QAAQ,UAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Log into Canvas using an access token and launch an LTI app
|
|
6
|
-
* @param accessToken the user's Canvas access token
|
|
7
|
-
* @param opts object containing all arguments
|
|
8
|
-
* @param opts.courseId the Canvas ID of the course to launch from
|
|
9
|
-
* @param opts.appName the name of the app as it appears in the course's left-hand nav
|
|
10
|
-
*/
|
|
11
|
-
launchLTIUsingToken(accessToken: string, opts?: {
|
|
12
|
-
courseId?: number;
|
|
13
|
-
appName?: string;
|
|
14
|
-
}): Chainable<void>;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
declare const launchLTIUsingToken: () => void;
|
|
19
|
-
export default launchLTIUsingToken;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference types="cypress" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/*----------------------------------------*/
|
|
5
|
-
/* --------------- Command -------------- */
|
|
6
|
-
/*----------------------------------------*/
|
|
7
|
-
var launchLTIUsingToken = function () {
|
|
8
|
-
Cypress.Commands.add('launchLTIUsingToken', function (accessToken, opts) {
|
|
9
|
-
if (opts === void 0) { opts = {}; }
|
|
10
|
-
var courseId = opts.courseId, appName = opts.appName;
|
|
11
|
-
if (!courseId) {
|
|
12
|
-
var envCourseId = Cypress.env('courseId');
|
|
13
|
-
if (!envCourseId) {
|
|
14
|
-
throw new Error('Could not find courseId in environment variables');
|
|
15
|
-
}
|
|
16
|
-
courseId = parseInt(envCourseId, 10);
|
|
17
|
-
}
|
|
18
|
-
if (!appName) {
|
|
19
|
-
appName = Cypress.env('appName');
|
|
20
|
-
if (!appName) {
|
|
21
|
-
throw new Error('Could not find appName in environment variables');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
cy.log("Launch LTI app \"".concat(appName, "\" in course ").concat(courseId, " using access token"));
|
|
25
|
-
// Get the external tools for the course
|
|
26
|
-
cy.visitCanvasEndpoint({
|
|
27
|
-
method: 'GET',
|
|
28
|
-
path: "/courses/".concat(courseId, "/external_tools"),
|
|
29
|
-
accessToken: accessToken
|
|
30
|
-
}).then(function (externalTools) {
|
|
31
|
-
cy.log("Found ".concat(externalTools.length, " external tools"));
|
|
32
|
-
// Find the external tool of interest
|
|
33
|
-
var toolId = 0;
|
|
34
|
-
for (var _i = 0, externalTools_1 = externalTools; _i < externalTools_1.length; _i++) {
|
|
35
|
-
var externalTool = externalTools_1[_i];
|
|
36
|
-
// Skip non-nav items
|
|
37
|
-
if (!externalTool.course_navigation || typeof externalTool.course_navigation !== 'object') {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
// Skip non-labeled items
|
|
41
|
-
if (!externalTool.course_navigation.text) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
// Check if this app matches the name
|
|
45
|
-
var thisAppName = externalTool.course_navigation.text.trim().toLowerCase();
|
|
46
|
-
if (thisAppName === appName.trim().toLowerCase()) {
|
|
47
|
-
toolId = externalTool.id;
|
|
48
|
-
cy.log("Found matching app: \"".concat(externalTool.course_navigation.text, "\" with ID ").concat(toolId));
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// Make sure we found the app
|
|
53
|
-
if (toolId === 0) {
|
|
54
|
-
throw new Error("Could not find any apps named \"".concat(appName, "\" in course ").concat(courseId));
|
|
55
|
-
}
|
|
56
|
-
// Get a sessionless launch URL
|
|
57
|
-
cy.visitCanvasEndpoint({
|
|
58
|
-
method: 'GET',
|
|
59
|
-
path: "/courses/".concat(courseId, "/external_tools/sessionless_launch?id=").concat(toolId),
|
|
60
|
-
accessToken: accessToken
|
|
61
|
-
}).then(function (sessionlessLaunchInfo) {
|
|
62
|
-
var launchURL = sessionlessLaunchInfo.url;
|
|
63
|
-
cy.log("Launching LTI app at: ".concat(launchURL));
|
|
64
|
-
// Launch the tool
|
|
65
|
-
cy.visit(launchURL);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
/*----------------------------------------*/
|
|
71
|
-
/* --------------- Export --------------- */
|
|
72
|
-
/*----------------------------------------*/
|
|
73
|
-
exports.default = launchLTIUsingToken;
|
|
74
|
-
//# sourceMappingURL=launchLTIUsingToken.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"launchLTIUsingToken.js","sourceRoot":"","sources":["../../src/commands/launchLTIUsingToken.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA6BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,mBAAmB,GAAG;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,qBAAqB,EACrB,UACE,WAAmB,EACnB,IAGM;QAHN,qBAAA,EAAA,SAGM;QAEF,IAAA,QAAQ,GAAc,IAAI,SAAlB,EAAE,OAAO,GAAK,IAAI,QAAT,CAAU;QAEjC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC5C,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACtE,CAAC;YACD,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SA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;YACR,CAAC;YAED,6BAA6B;YAC7B,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,0CAAkC,OAAO,0BAAe,QAAQ,CAAE,CAAC,CAAC;YACtF,CAAC;YAED,+BAA+B;YAC/B,EAAE,CAAC,mBAAmB,CAAC;gBACrB,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,mBAAY,QAAQ,mDAAyC,MAAM,CAAE;gBAC3E,WAAW,EAAE,WAAW;aACzB,CAAC,CAAC,IAAI,CAAC,UAAC,qBAA0B;gBACjC,IAAM,SAAS,GAAG,qBAAqB,CAAC,GAAG,CAAC;gBAC5C,EAAE,CAAC,GAAG,CAAC,gCAAyB,SAAS,CAAE,CAAC,CAAC;gBAE7C,kBAAkB;gBAClB,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,mBAAmB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Get the labels of all the options within a select element
|
|
6
|
-
* @author Allison Zhang
|
|
7
|
-
* @param selector the CSS selector of the select element
|
|
8
|
-
* @returns an array of strings representing the labels of the options
|
|
9
|
-
*/
|
|
10
|
-
listSelectLabels(selector: string): Chainable<String[]>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
declare const listSelectLabels: () => void;
|
|
15
|
-
export default listSelectLabels;
|