dceky 1.0.0-beta-yuenler.1 → 1.0.0-beta-auto-import.1
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/.eslintrc.js +93 -0
- package/lib/commands/assertDoesNotHaveClass.d.ts +2 -1
- package/lib/commands/assertDoesNotHaveClass.js.map +1 -1
- package/lib/commands/assertHasClass.d.ts +2 -1
- package/lib/commands/assertHasClass.js.map +1 -1
- package/lib/commands/assertNumElements.d.ts +2 -1
- package/lib/commands/assertNumElements.js.map +1 -1
- package/lib/commands/clickWithRetry.d.ts +8 -4
- package/lib/commands/clickWithRetry.js +3 -3
- package/lib/commands/clickWithRetry.js.map +1 -1
- package/lib/commands/getNumElements.d.ts +4 -4
- package/lib/commands/getNumElements.js +1 -1
- package/lib/commands/getNumElements.js.map +1 -1
- package/lib/commands/handleHarvardKey.d.ts +9 -3
- package/lib/commands/handleHarvardKey.js +20 -24
- package/lib/commands/handleHarvardKey.js.map +1 -1
- package/lib/commands/handleHarvardKey2.d.ts +14 -0
- package/lib/commands/handleHarvardKey2.js +88 -0
- package/lib/commands/handleHarvardKey2.js.map +1 -0
- package/lib/commands/launchAs.d.ts +14 -12
- package/lib/commands/launchAs.js +24 -23
- package/lib/commands/launchAs.js.map +1 -1
- package/lib/commands/launchLTIUsingToken.d.ts +9 -4
- package/lib/commands/launchLTIUsingToken.js +25 -14
- package/lib/commands/launchLTIUsingToken.js.map +1 -1
- package/lib/commands/navigateToHref.d.ts +4 -9
- package/lib/commands/navigateToHref.js +10 -3
- package/lib/commands/navigateToHref.js.map +1 -1
- package/lib/commands/runScript.d.ts +3 -3
- package/lib/commands/runScript.js +2 -6
- package/lib/commands/runScript.js.map +1 -1
- package/lib/commands/typeInto.d.ts +5 -2
- package/lib/commands/typeInto.js +14 -4
- package/lib/commands/typeInto.js.map +1 -1
- package/lib/commands/visitCanvasGETEndpoint.d.ts +2 -2
- package/lib/commands/visitCanvasGETEndpoint.js +4 -4
- package/lib/commands/visitCanvasGETEndpoint.js.map +1 -1
- package/lib/commands/waitForElementVisible.d.ts +3 -2
- package/lib/commands/waitForElementVisible.js +1 -2
- package/lib/commands/waitForElementVisible.js.map +1 -1
- package/lib/genCommandPaths.d.ts +9 -0
- package/lib/genCommandPaths.js +86 -0
- package/lib/genCommandPaths.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/init.d.ts +1 -5
- package/lib/init.js +71 -33
- package/lib/init.js.map +1 -1
- package/package.json +8 -2
- package/src/commands/assertDoesNotHaveClass.ts +20 -9
- package/src/commands/assertHasClass.ts +20 -9
- package/src/commands/assertNumElements.ts +20 -6
- package/src/commands/getNumElements.ts +17 -10
- package/src/commands/handleHarvardKey.ts +68 -53
- package/src/commands/launchAs.ts +79 -63
- package/src/commands/launchLTIUsingToken.ts +78 -47
- package/src/commands/navigateToHref.ts +28 -17
- package/src/commands/runScript.ts +16 -11
- package/src/commands/typeInto.ts +54 -26
- package/src/commands/visitCanvasGETEndpoint.ts +29 -16
- package/src/commands/waitForElementVisible.ts +19 -10
- package/src/genCommandPaths.ts +65 -0
- package/src/index.ts +2 -3
- package/src/init.ts +80 -34
- package/.eslintrc.json +0 -58
- package/src/commands/clickWithRetry.ts +0 -51
|
@@ -5,33 +5,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
7
|
var launchLTIUsingToken = function () {
|
|
8
|
-
Cypress.Commands.add('launchLTIUsingToken', function (accessToken,
|
|
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 = Number.parseInt(envCourseId, 10);
|
|
17
|
+
}
|
|
18
|
+
appName = appName || Cypress.env('appName');
|
|
19
|
+
if (!appName) {
|
|
20
|
+
throw new Error('Could not find appName in environment variables');
|
|
21
|
+
}
|
|
9
22
|
cy.log("Launch LTI app \"".concat(appName, "\" in course ").concat(courseId, " using access token"));
|
|
10
23
|
// Get the external tools for the course
|
|
11
24
|
cy.visitCanvasGETEndpoint({
|
|
12
25
|
path: "/courses/".concat(courseId, "/external_tools"),
|
|
13
|
-
accessToken: accessToken
|
|
26
|
+
accessToken: accessToken,
|
|
14
27
|
}).then(function (externalTools) {
|
|
15
28
|
cy.log("Found ".concat(externalTools.length, " external tools"));
|
|
16
29
|
// Find the external tool of interest
|
|
17
|
-
var
|
|
18
|
-
for (var _i = 0, externalTools_1 = externalTools; _i < externalTools_1.length; _i++) {
|
|
19
|
-
var externalTool = externalTools_1[_i];
|
|
30
|
+
var matchingTool = externalTools.find(function (externalTool) {
|
|
20
31
|
// Skip non-nav items
|
|
21
32
|
if (!externalTool.course_navigation || typeof externalTool.course_navigation !== 'object') {
|
|
22
|
-
|
|
33
|
+
return false;
|
|
23
34
|
}
|
|
24
35
|
// Skip non-labeled items
|
|
25
36
|
if (!externalTool.course_navigation.text) {
|
|
26
|
-
|
|
37
|
+
return false;
|
|
27
38
|
}
|
|
28
|
-
//
|
|
39
|
+
// Skip if the app name does not match the expected name
|
|
29
40
|
var thisAppName = externalTool.course_navigation.text.trim().toLowerCase();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
return thisAppName === appName.trim().toLowerCase();
|
|
42
|
+
});
|
|
43
|
+
var toolId = (matchingTool === null || matchingTool === void 0 ? void 0 : matchingTool.id) || 0;
|
|
44
|
+
if (matchingTool) {
|
|
45
|
+
cy.log("Found matching app: \"".concat(matchingTool.course_navigation.text, "\" with ID ").concat(toolId));
|
|
35
46
|
}
|
|
36
47
|
// Make sure we found the app
|
|
37
48
|
if (toolId === 0) {
|
|
@@ -40,7 +51,7 @@ var launchLTIUsingToken = function () {
|
|
|
40
51
|
// Get a sessionless launch URL
|
|
41
52
|
cy.visitCanvasGETEndpoint({
|
|
42
53
|
path: "/courses/".concat(courseId, "/external_tools/sessionless_launch?id=").concat(toolId),
|
|
43
|
-
accessToken: accessToken
|
|
54
|
+
accessToken: accessToken,
|
|
44
55
|
}).then(function (sessionlessLaunchInfo) {
|
|
45
56
|
var launchURL = sessionlessLaunchInfo.url;
|
|
46
57
|
cy.log("Launching LTI app at: ".concat(launchURL));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchLTIUsingToken.js","sourceRoot":"","sources":["../../src/commands/launchLTIUsingToken.ts"],"names":[],"mappings":";AAAA,iCAAiC;;
|
|
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;QAEA,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,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC9C,CAAC;QAED,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QAED,EAAE,CAAC,GAAG,CAAC,2BAAmB,OAAO,0BAAe,QAAQ,wBAAqB,CAAC,CAAC;QAE/E,wCAAwC;QACxC,EAAE,CAAC,sBAAsB,CAAC;YACxB,IAAI,EAAE,mBAAY,QAAQ,oBAAiB;YAC3C,WAAW,aAAA;SACZ,CAAC,CAAC,IAAI,CAAC,UAAC,aAAuC;YAC9C,EAAE,CAAC,GAAG,CAAC,gBAAS,aAAa,CAAC,MAAM,oBAAiB,CAAC,CAAC;YAEvD,qCAAqC;YACrC,IAAM,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC,UAAC,YAAY;gBACnD,qBAAqB;gBACrB,IAAI,CAAC,YAAY,CAAC,iBAAiB,IAAI,OAAO,YAAY,CAAC,iBAAiB,KAAK,QAAQ,EAAE,CAAC;oBAC1F,OAAO,KAAK,CAAC;gBACf,CAAC;gBAED,yBAAyB;gBACzB,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;oBACzC,OAAO,KAAK,CAAC;gBACf,CAAC;gBAED,wDAAwD;gBACxD,IAAM,WAAW,GAAG,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;gBAC7E,OAAO,WAAW,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACtD,CAAC,CAAC,CAAC;YAEH,IAAM,MAAM,GAAG,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,KAAI,CAAC,CAAC;YACrC,IAAI,YAAY,EAAE,CAAC;gBACjB,EAAE,CAAC,GAAG,CAAC,gCAAwB,YAAY,CAAC,iBAAiB,CAAC,IAAI,wBAAa,MAAM,CAAE,CAAC,CAAC;YAC3F,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,sBAAsB,CAAC;gBACxB,IAAI,EAAE,mBAAY,QAAQ,mDAAyC,MAAM,CAAE;gBAC3E,WAAW,aAAA;aACZ,CAAC,CAAC,IAAI,CAAC,UAAC,qBAAqB;gBAC5B,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,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,mBAAmB,CAAC"}
|
|
@@ -3,16 +3,11 @@ declare global {
|
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
5
|
* Navigate to href attribute of Harvard identity provider button
|
|
6
|
-
* @
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
9
|
-
* @returns The full URL constructed from the href
|
|
10
|
-
* @example cy.navigateToHref({ item: '#login-button', domain: 'https://example.com' })
|
|
6
|
+
* @author Yuen Ler Chow
|
|
7
|
+
* @param item the CSS selector of interest
|
|
8
|
+
* @return Cypress chainable containing the full URL string (hostname + href attribute value)
|
|
11
9
|
*/
|
|
12
|
-
navigateToHref(
|
|
13
|
-
item: string;
|
|
14
|
-
domain: string;
|
|
15
|
-
}): Chainable<string>;
|
|
10
|
+
navigateToHref(item: string): Chainable<string>;
|
|
16
11
|
}
|
|
17
12
|
}
|
|
18
13
|
}
|
|
@@ -5,14 +5,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
7
|
var navigateToHref = function () {
|
|
8
|
-
Cypress.Commands.add('navigateToHref', function (
|
|
9
|
-
var item = opts.item, domain = opts.domain;
|
|
8
|
+
Cypress.Commands.add('navigateToHref', function (item) {
|
|
10
9
|
cy.waitForElementVisible(item);
|
|
10
|
+
// get hostname from current URL
|
|
11
|
+
var hostname = cy.url().then(function (url) {
|
|
12
|
+
return new URL(url).hostname;
|
|
13
|
+
});
|
|
11
14
|
return cy
|
|
12
15
|
.get(item)
|
|
13
16
|
.invoke('attr', 'href')
|
|
14
17
|
.then(function (href) {
|
|
15
|
-
|
|
18
|
+
// If the href is a relative URL, prepend the hostname
|
|
19
|
+
if (href.startsWith('/')) {
|
|
20
|
+
return hostname + href;
|
|
21
|
+
}
|
|
22
|
+
return href;
|
|
16
23
|
});
|
|
17
24
|
});
|
|
18
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigateToHref.js","sourceRoot":"","sources":["../../src/commands/navigateToHref.ts"],"names":[],"mappings":";AAAA,iCAAiC;;
|
|
1
|
+
{"version":3,"file":"navigateToHref.js","sourceRoot":"","sources":["../../src/commands/navigateToHref.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAoBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,cAAc,GAAG;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,gBAAgB,EAChB,UACE,IAAY;QAEZ,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAE/B,gCAAgC;QAChC,IAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAC,GAAW;YACzC,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE;aACN,GAAG,CAAC,IAAI,CAAC;aACT,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;aACtB,IAAI,CAAC,UAAC,IAAY;YACjB,sDAAsD;YACtD,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,OAAO,QAAQ,GAAG,IAAI,CAAC;YACzB,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,cAAc,CAAC"}
|
|
@@ -3,13 +3,13 @@ declare global {
|
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
5
|
* Run a script on the page
|
|
6
|
+
* @author Yuen Ler Chow
|
|
6
7
|
* @param scriptLines the script to run in an anonymous function on the page.
|
|
7
8
|
* If multiple script arguments are included, each argument will be considered a
|
|
8
9
|
* new line of the script.
|
|
9
|
-
* @
|
|
10
|
-
* @example cy.runScript('console.log("Hello");', 'return document.title;')
|
|
10
|
+
* @return Cypress chainable containing the return value from executing the script
|
|
11
11
|
*/
|
|
12
|
-
runScript(
|
|
12
|
+
runScript(scriptLines: string): Chainable<any>;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -5,13 +5,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
/* --------------- Command -------------- */
|
|
6
6
|
/*----------------------------------------*/
|
|
7
7
|
var runScript = function () {
|
|
8
|
-
Cypress.Commands.add('runScript', function () {
|
|
9
|
-
var scriptLines = [];
|
|
10
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
11
|
-
scriptLines[_i] = arguments[_i];
|
|
12
|
-
}
|
|
8
|
+
Cypress.Commands.add('runScript', function (scriptLines) {
|
|
13
9
|
cy.log('Running script');
|
|
14
|
-
var fullScript = scriptLines
|
|
10
|
+
var fullScript = scriptLines;
|
|
15
11
|
return cy.window().then(function (win) {
|
|
16
12
|
var result = win.eval(fullScript);
|
|
17
13
|
return cy.wrap(result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runScript.js","sourceRoot":"","sources":["../../src/commands/runScript.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,SAAS,GAAG;IAChB,OAAO,CAAC,QAAQ,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"runScript.js","sourceRoot":"","sources":["../../src/commands/runScript.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,SAAS,GAAG;IAChB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,WAAW,EACX,UACE,WAAmB;QAEnB,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACzB,IAAM,UAAU,GAAG,WAAW,CAAC;QAC/B,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAC,GAAG;YAC1B,IAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACpC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,SAAS,CAAC"}
|
|
@@ -3,16 +3,19 @@ declare global {
|
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
5
|
* Type text into an element. This function first removes the previous text in the element
|
|
6
|
+
* @author Yuen Ler Chow
|
|
6
7
|
* @param opts object containing all arguments
|
|
7
8
|
* @param opts.item the CSS selector of interest
|
|
8
9
|
* @param opts.text the text to type
|
|
9
|
-
* @param opts.pressEnter if true, after typing into the text field, simulate pressing enter
|
|
10
|
-
* @
|
|
10
|
+
* @param [opts.pressEnter] if true, after typing into the text field, simulate pressing enter
|
|
11
|
+
* @param [opts.append] if true, append the text to the end of the existing text in the element instead of replacing it
|
|
12
|
+
* @return Cypress chainable containing the input element that text was typed into
|
|
11
13
|
*/
|
|
12
14
|
typeInto(opts: {
|
|
13
15
|
item: string;
|
|
14
16
|
text: string;
|
|
15
17
|
pressEnter?: boolean;
|
|
18
|
+
append?: boolean;
|
|
16
19
|
}): Chainable<Element>;
|
|
17
20
|
}
|
|
18
21
|
}
|
package/lib/commands/typeInto.js
CHANGED
|
@@ -6,15 +6,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
/*----------------------------------------*/
|
|
7
7
|
var typeInto = function () {
|
|
8
8
|
Cypress.Commands.add('typeInto', function (opts) {
|
|
9
|
-
var item = opts.item, text = opts.text, pressEnter = opts.pressEnter;
|
|
9
|
+
var item = opts.item, text = opts.text, pressEnter = opts.pressEnter, append = opts.append;
|
|
10
10
|
cy.log("Type \"".concat(text, "\" into ").concat(item));
|
|
11
11
|
// Check if the text contains an enter key press
|
|
12
12
|
var enterAtEndOfText = text.charAt(text.length - 1) === '\n';
|
|
13
13
|
// Type the text without a trailing enter if there was one
|
|
14
|
-
var textWithoutTrailingEnter = enterAtEndOfText
|
|
14
|
+
var textWithoutTrailingEnter = (enterAtEndOfText
|
|
15
15
|
? text.substring(0, text.length - 1)
|
|
16
|
-
: text;
|
|
17
|
-
|
|
16
|
+
: text);
|
|
17
|
+
if (append) {
|
|
18
|
+
cy
|
|
19
|
+
.get(item)
|
|
20
|
+
.type(textWithoutTrailingEnter);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
cy
|
|
24
|
+
.get(item)
|
|
25
|
+
.clear()
|
|
26
|
+
.type(textWithoutTrailingEnter);
|
|
27
|
+
}
|
|
18
28
|
// Press enter if explicitly requested or if text ended with newline
|
|
19
29
|
if (pressEnter || enterAtEndOfText) {
|
|
20
30
|
cy.get(item).type('{enter}');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeInto.js","sourceRoot":"","sources":["../../src/commands/typeInto.ts"],"names":[],"mappings":";AAAA,iCAAiC;;
|
|
1
|
+
{"version":3,"file":"typeInto.js","sourceRoot":"","sources":["../../src/commands/typeInto.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,IAKC;QAGC,IAAA,IAAI,GACF,IAAI,KADF,EAAE,IAAI,GACR,IAAI,KADI,EAAE,UAAU,GACpB,IAAI,WADgB,EAAE,MAAM,GAC5B,IAAI,OADwB,CACvB;QACT,EAAE,CAAC,GAAG,CAAC,iBAAS,IAAI,qBAAU,IAAI,CAAE,CAAC,CAAC;QAEtC,gDAAgD;QAChD,IAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;QAE/D,0DAA0D;QAC1D,IAAM,wBAAwB,GAAG,CAC/B,gBAAgB;YACd,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YACpC,CAAC,CAAC,IAAI,CACT,CAAC;QAEF,IAAI,MAAM,EAAE,CAAC;YACX,EAAE;iBACC,GAAG,CAAC,IAAI,CAAC;iBACT,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,EAAE;iBACC,GAAG,CAAC,IAAI,CAAC;iBACT,KAAK,EAAE;iBACP,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACpC,CAAC;QAED,oEAAoE;QACpE,IAAI,UAAU,IAAI,gBAAgB,EAAE,CAAC;YACnC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,QAAQ,CAAC"}
|
|
@@ -3,11 +3,11 @@ declare global {
|
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
5
|
* Makes a GET request to Canvas API endpoint
|
|
6
|
+
* @author Yuen Ler Chow
|
|
6
7
|
* @param opts object containing all arguments
|
|
7
8
|
* @param opts.path The API path (e.g., '/courses', '/users/self')
|
|
8
9
|
* @param opts.accessToken The Canvas access token
|
|
9
|
-
* @
|
|
10
|
-
* @example cy.visitCanvasGETEndpoint({ path: '/courses', accessToken: 'your_token' })
|
|
10
|
+
* @return Cypress chainable containing the Canvas API response body
|
|
11
11
|
*/
|
|
12
12
|
visitCanvasGETEndpoint(opts: {
|
|
13
13
|
path: string;
|
|
@@ -8,14 +8,14 @@ var visitCanvasGETEndpoint = function () {
|
|
|
8
8
|
Cypress.Commands.add('visitCanvasGETEndpoint', function (opts) {
|
|
9
9
|
cy.log('Visiting Canvas GET endpoint');
|
|
10
10
|
var path = opts.path, accessToken = opts.accessToken;
|
|
11
|
-
cy.log(
|
|
11
|
+
cy.log("Canvas API: ".concat(path));
|
|
12
12
|
return cy.request({
|
|
13
13
|
method: 'GET',
|
|
14
|
-
url:
|
|
14
|
+
url: "https://canvas.harvard.edu/api/v1".concat(path),
|
|
15
15
|
qs: {
|
|
16
16
|
per_page: 200,
|
|
17
|
-
access_token: accessToken
|
|
18
|
-
}
|
|
17
|
+
access_token: accessToken,
|
|
18
|
+
},
|
|
19
19
|
}).its('body');
|
|
20
20
|
});
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitCanvasGETEndpoint.js","sourceRoot":"","sources":["../../src/commands/visitCanvasGETEndpoint.ts"],"names":[],"mappings":";AAAA,iCAAiC;;
|
|
1
|
+
{"version":3,"file":"visitCanvasGETEndpoint.js","sourceRoot":"","sources":["../../src/commands/visitCanvasGETEndpoint.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA2BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,sBAAsB,GAAG;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,wBAAwB,EACxB,UACE,IAGC;QAED,EAAE,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC/B,IAAA,IAAI,GAAkB,IAAI,KAAtB,EAAE,WAAW,GAAK,IAAI,YAAT,CAAU;QAEnC,EAAE,CAAC,GAAG,CAAC,sBAAe,IAAI,CAAE,CAAC,CAAC;QAC9B,OAAO,EAAE,CAAC,OAAO,CAAC;YAChB,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,2CAAoC,IAAI,CAAE;YAC/C,EAAE,EAAE;gBACF,QAAQ,EAAE,GAAG;gBACb,YAAY,EAAE,WAAW;aAC1B;SACF,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,sBAAsB,CAAC"}
|
|
@@ -3,9 +3,10 @@ declare global {
|
|
|
3
3
|
interface Chainable {
|
|
4
4
|
/**
|
|
5
5
|
* Wait for an element to be visible
|
|
6
|
+
* @author Yuen Ler Chow
|
|
6
7
|
* @param item the CSS selector of interest
|
|
7
|
-
* @param timeoutSec the number of seconds to wait before timing out
|
|
8
|
-
* @
|
|
8
|
+
* @param [timeoutSec=10] the number of seconds to wait before timing out
|
|
9
|
+
* @return Cypress chainable containing the visible element
|
|
9
10
|
*/
|
|
10
11
|
waitForElementVisible(item: string, timeoutSec?: number): Chainable<JQuery<HTMLElement>>;
|
|
11
12
|
}
|
|
@@ -7,8 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
var waitForElementVisible = function () {
|
|
8
8
|
Cypress.Commands.add('waitForElementVisible', function (item, timeoutSec) {
|
|
9
9
|
cy.log('Waiting for element to be visible');
|
|
10
|
-
|
|
11
|
-
var timeoutMs = timeoutSec * 1000;
|
|
10
|
+
var timeoutMs = (timeoutSec || 10) * 1000;
|
|
12
11
|
cy.log("Wait for ".concat(item, " to be visible"));
|
|
13
12
|
return cy.get(item, { timeout: timeoutMs }).should('be.visible');
|
|
14
13
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForElementVisible.js","sourceRoot":"","sources":["../../src/commands/waitForElementVisible.ts"],"names":[],"mappings":";AAAA,iCAAiC;;
|
|
1
|
+
{"version":3,"file":"waitForElementVisible.js","sourceRoot":"","sources":["../../src/commands/waitForElementVisible.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAwBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,qBAAqB,GAAG;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,uBAAuB,EACvB,UACE,IAAY,EACZ,UAAmB;QAEnB,EAAE,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QAE5C,IAAM,SAAS,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QAC5C,EAAE,CAAC,GAAG,CAAC,mBAAY,IAAI,mBAAgB,CAAC,CAAC;QACzC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnE,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a file containing paths to all command files in cypress/commands
|
|
3
|
+
* This should be called from cypress.config.js (Node.js context)
|
|
4
|
+
* @param projectRoot - The root directory of the Cypress project (optional, defaults to process.cwd())
|
|
5
|
+
* @returns The path to the generated file
|
|
6
|
+
* @author Gabe Abrams
|
|
7
|
+
*/
|
|
8
|
+
declare const genCommandPaths: () => string;
|
|
9
|
+
export default genCommandPaths;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
var fs = __importStar(require("fs"));
|
|
37
|
+
var path = __importStar(require("path"));
|
|
38
|
+
/**
|
|
39
|
+
* Generate a file containing paths to all command files in cypress/commands
|
|
40
|
+
* This should be called from cypress.config.js (Node.js context)
|
|
41
|
+
* @param projectRoot - The root directory of the Cypress project (optional, defaults to process.cwd())
|
|
42
|
+
* @returns The path to the generated file
|
|
43
|
+
* @author Gabe Abrams
|
|
44
|
+
*/
|
|
45
|
+
var genCommandPaths = function () {
|
|
46
|
+
var root = process.cwd();
|
|
47
|
+
var cypressCommandsDir = path.resolve(root, 'cypress', 'commands');
|
|
48
|
+
var outputFile = path.resolve(cypressCommandsDir, '.dceky-paths.js');
|
|
49
|
+
// Check if the directory exists
|
|
50
|
+
if (!fs.existsSync(cypressCommandsDir)) {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
console.warn("Cypress commands directory not found at: ".concat(cypressCommandsDir));
|
|
53
|
+
// Create an empty file so init doesn't fail
|
|
54
|
+
fs.writeFileSync(outputFile, 'module.exports = [];\n');
|
|
55
|
+
return outputFile;
|
|
56
|
+
}
|
|
57
|
+
// Get all files in the directory
|
|
58
|
+
var files = fs.readdirSync(cypressCommandsDir);
|
|
59
|
+
var commandPaths = [];
|
|
60
|
+
// Filter out non-JS/TS files and process each file
|
|
61
|
+
files.forEach(function (file) {
|
|
62
|
+
// Skip non-JS files (like .d.ts, .map, etc.)
|
|
63
|
+
if (!file.endsWith('.js') && !file.endsWith('.ts')) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// Skip index files and the generated paths file
|
|
67
|
+
if (file === 'index.js' || file === 'index.ts' || file === '.dceky-paths.js') {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
var filePath = path.join(cypressCommandsDir, file);
|
|
71
|
+
// Check if it's a file (not a directory)
|
|
72
|
+
var stats = fs.statSync(filePath);
|
|
73
|
+
if (!stats.isFile()) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// Store the relative path from cypress/commands
|
|
77
|
+
commandPaths.push(file);
|
|
78
|
+
});
|
|
79
|
+
var content = "// Auto-generated by dceky - do not edit manually\nmodule.exports = ".concat(JSON.stringify(commandPaths, null, 2), ";\n");
|
|
80
|
+
fs.writeFileSync(outputFile, content);
|
|
81
|
+
// eslint-disable-next-line no-console
|
|
82
|
+
console.log("Generated command paths file: ".concat(outputFile, " (").concat(commandPaths.length, " commands)"));
|
|
83
|
+
return outputFile;
|
|
84
|
+
};
|
|
85
|
+
exports.default = genCommandPaths;
|
|
86
|
+
//# sourceMappingURL=genCommandPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genCommandPaths.js","sourceRoot":"","sources":["../src/genCommandPaths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AACzB,yCAA6B;AAE7B;;;;;;GAMG;AACH,IAAM,eAAe,GAAG;IACtB,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC3B,IAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACrE,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;IAEvE,gCAAgC;IAChC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACvC,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,mDAA4C,kBAAkB,CAAE,CAAC,CAAC;QAC/E,4CAA4C;QAC5C,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;QACvD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,iCAAiC;IACjC,IAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACjD,IAAM,YAAY,GAAa,EAAE,CAAC;IAElC,mDAAmD;IACnD,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI;QACjB,6CAA6C;QAC7C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACnD,OAAO;QACT,CAAC;QAED,gDAAgD;QAChD,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,iBAAiB,EAAE,CAAC;YAC7E,OAAO;QACT,CAAC;QAED,IAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QAErD,yCAAyC;QACzC,IAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,gDAAgD;QAChD,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,IAAM,OAAO,GAAG,8EACC,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,QACvD,CAAC;IAEA,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEtC,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,wCAAiC,UAAU,eAAK,YAAY,CAAC,MAAM,eAAY,CAAC,CAAC;IAE7F,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -3,12 +3,12 @@ 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
|
-
exports.init = exports.genConfiguration = void 0;
|
|
6
|
+
exports.init = exports.genCommandPaths = exports.genConfiguration = void 0;
|
|
7
7
|
// Import helpers
|
|
8
8
|
var init_1 = __importDefault(require("./init"));
|
|
9
9
|
exports.init = init_1.default;
|
|
10
10
|
var genConfiguration_1 = __importDefault(require("./genConfiguration"));
|
|
11
11
|
exports.genConfiguration = genConfiguration_1.default;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
var genCommandPaths_1 = __importDefault(require("./genCommandPaths"));
|
|
13
|
+
exports.genCommandPaths = genCommandPaths_1.default;
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iBAAiB;AACjB,gDAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iBAAiB;AACjB,gDAA0B;AAQxB,eARK,cAAI,CAQL;AAPN,wEAAkD;AAKhD,2BALK,0BAAgB,CAKL;AAJlB,sEAAgD;AAK9C,0BALK,yBAAe,CAKL"}
|
package/lib/init.d.ts
CHANGED
package/lib/init.js
CHANGED
|
@@ -3,39 +3,77 @@ 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
|
-
|
|
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
|
-
|
|
6
|
+
var path_1 = __importDefault(require("path"));
|
|
7
|
+
// // Import all commands
|
|
8
|
+
// import assertDoesNotHaveClass from './commands/assertDoesNotHaveClass';
|
|
9
|
+
// import assertHasClass from './commands/assertHasClass';
|
|
10
|
+
// import assertNumElements from './commands/assertNumElements';
|
|
11
|
+
// import getNumElements from './commands/getNumElements';
|
|
12
|
+
// import handleHarvardKey from './commands/handleHarvardKey';
|
|
13
|
+
// import launchAs from './commands/launchAs';
|
|
14
|
+
// import launchLTIUsingToken from './commands/launchLTIUsingToken';
|
|
15
|
+
// import navigateToHref from './commands/navigateToHref';
|
|
16
|
+
// import runScript from './commands/runScript';
|
|
17
|
+
// import typeInto from './commands/typeInto';
|
|
18
|
+
// import visitCanvasGETEndpoint from './commands/visitCanvasGETEndpoint';
|
|
19
|
+
// import waitForElementVisible from './commands/waitForElementVisible';
|
|
20
|
+
// /**
|
|
21
|
+
// * Initialize custom commands
|
|
22
|
+
// * @author Gabe Abrams
|
|
23
|
+
// */
|
|
24
|
+
// const init = (CypressRequire: <T = any>(id: string) => T) => {
|
|
25
|
+
// // Execute each built-in command adder
|
|
26
|
+
// assertDoesNotHaveClass();
|
|
27
|
+
// assertHasClass();
|
|
28
|
+
// assertNumElements();
|
|
29
|
+
// getNumElements();
|
|
30
|
+
// handleHarvardKey();
|
|
31
|
+
// launchAs();
|
|
32
|
+
// launchLTIUsingToken();
|
|
33
|
+
// navigateToHref();
|
|
34
|
+
// runScript();
|
|
35
|
+
// typeInto();
|
|
36
|
+
// visitCanvasGETEndpoint();
|
|
37
|
+
// waitForElementVisible();
|
|
38
|
+
// /* --------------- Run Cypress.Require on consumer's commands --------------- */
|
|
39
|
+
// try {
|
|
40
|
+
// // const commandPaths: string[] = CypressRequire('cypress/commands/.dceky-paths.js');
|
|
41
|
+
// // cy.log('commandPaths', commandPaths);
|
|
42
|
+
// // commandPaths.forEach((file) => {
|
|
43
|
+
// // try {
|
|
44
|
+
// // CypressRequire(`cypress/commands/${file}`);
|
|
45
|
+
// // } catch (error) {
|
|
46
|
+
// // // eslint-disable-next-line no-console
|
|
47
|
+
// // console.error(`Error loading command from ${file}:`, error);
|
|
48
|
+
// // }
|
|
49
|
+
// // });
|
|
50
|
+
// CypressRequire('../commands/playVideo.ts').default();
|
|
51
|
+
// } catch (error) {
|
|
52
|
+
// // eslint-disable-next-line no-console
|
|
53
|
+
// console.warn(
|
|
54
|
+
// `Could not load consumer commands. Make sure to call genCommandPaths() in your cypress.config.js: ${error}`,
|
|
55
|
+
// );
|
|
56
|
+
// }
|
|
57
|
+
// };
|
|
58
|
+
// export default init;
|
|
59
|
+
var init = function (CypressRequire, c) {
|
|
60
|
+
c.log('dceky init called!');
|
|
61
|
+
try {
|
|
62
|
+
// const pwd = (process.env.PWD || process.env.CWD);
|
|
63
|
+
var pwd = __dirname;
|
|
64
|
+
c.log('pwd:', pwd);
|
|
65
|
+
var playVideoPath = path_1.default.join(pwd, '../../../../cypress/commands/playVideo.ts');
|
|
66
|
+
c.log('playVideoPath:', playVideoPath);
|
|
67
|
+
c.log('About to require playVideo...');
|
|
68
|
+
var playVideoModule = CypressRequire(playVideoPath);
|
|
69
|
+
c.log('playVideo module:', playVideoModule);
|
|
70
|
+
playVideoModule.default();
|
|
71
|
+
c.log('playVideo.default() called successfully');
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
c.log('Error in dceky init:', error.message);
|
|
75
|
+
c.log("Could not load consumer commands. Make sure to call genCommandPaths() in your cypress.config.js: ".concat(error));
|
|
76
|
+
}
|
|
39
77
|
};
|
|
40
78
|
exports.default = init;
|
|
41
79
|
//# sourceMappingURL=init.js.map
|
package/lib/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;AACA,8CAAwB;AACxB,yBAAyB;AACzB,0EAA0E;AAC1E,0DAA0D;AAC1D,gEAAgE;AAChE,0DAA0D;AAC1D,8DAA8D;AAC9D,8CAA8C;AAC9C,oEAAoE;AACpE,0DAA0D;AAC1D,gDAAgD;AAChD,8CAA8C;AAC9C,0EAA0E;AAC1E,wEAAwE;AAExE,MAAM;AACN,gCAAgC;AAChC,yBAAyB;AACzB,MAAM;AACN,iEAAiE;AACjE,2CAA2C;AAC3C,8BAA8B;AAC9B,sBAAsB;AACtB,yBAAyB;AACzB,sBAAsB;AACtB,wBAAwB;AACxB,gBAAgB;AAChB,2BAA2B;AAC3B,sBAAsB;AACtB,iBAAiB;AACjB,gBAAgB;AAChB,8BAA8B;AAC9B,6BAA6B;AAE7B,qFAAqF;AAErF,UAAU;AACV,4FAA4F;AAE5F,+CAA+C;AAE/C,0CAA0C;AAC1C,iBAAiB;AACjB,yDAAyD;AACzD,6BAA6B;AAC7B,oDAAoD;AACpD,0EAA0E;AAC1E,aAAa;AACb,aAAa;AACb,4DAA4D;AAC5D,sBAAsB;AACtB,6CAA6C;AAC7C,oBAAoB;AACpB,qHAAqH;AACrH,SAAS;AACT,MAAM;AACN,KAAK;AAEL,uBAAuB;AAEvB,IAAM,IAAI,GAAG,UAAC,cAA0C,EAAE,CAAM;IAC9D,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC5B,IAAI,CAAC;QACH,oDAAoD;QACpD,IAAM,GAAG,GAAG,SAAS,CAAC;QACtB,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACnB,IAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,2CAA2C,CAAC,CAAC;QAClF,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;QACvC,CAAC,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QACvC,IAAM,eAAe,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;QACtD,CAAC,CAAC,GAAG,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;QAC5C,eAAe,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,CAAC,CAAC,GAAG,CAAC,sBAAsB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7C,CAAC,CAAC,GAAG,CACH,2GAAoG,KAAK,CAAE,CAC5G,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dceky",
|
|
3
|
-
"version": "1.0.0-beta-
|
|
3
|
+
"version": "1.0.0-beta-auto-import.1",
|
|
4
4
|
"description": "Cypress toolkit for Harvard DCE",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -27,6 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.7.0",
|
|
30
|
-
"typescript": "^5.9.3"
|
|
30
|
+
"typescript": "^5.9.3",
|
|
31
|
+
"eslint": "^8.42.0",
|
|
32
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
33
|
+
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
34
|
+
"eslint-plugin-import": "^2.32.0",
|
|
35
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
36
|
+
"eslint-plugin-react": "^7.37.5"
|
|
31
37
|
}
|
|
32
38
|
}
|