dceky 1.0.5-beta.ky-declarations.13 → 1.0.6

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.
Files changed (243) hide show
  1. package/README.md +45 -29
  2. package/lib/commands/assertDoesNotHaveClass.d.ts +18 -0
  3. package/lib/commands/assertDoesNotHaveClass.js +17 -0
  4. package/lib/commands/assertDoesNotHaveClass.js.map +1 -0
  5. package/lib/commands/assertHasClass.d.ts +18 -0
  6. package/lib/commands/assertHasClass.js +17 -0
  7. package/lib/commands/assertHasClass.js.map +1 -0
  8. package/lib/commands/assertNumElements.d.ts +18 -0
  9. package/lib/commands/assertNumElements.js +17 -0
  10. package/lib/commands/assertNumElements.js.map +1 -0
  11. package/lib/commands/clickWithRetry.d.ts +19 -0
  12. package/lib/commands/clickWithRetry.js +29 -0
  13. package/lib/commands/clickWithRetry.js.map +1 -0
  14. package/lib/commands/genTextOfLength.d.ts +20 -0
  15. package/lib/commands/genTextOfLength.js +20 -0
  16. package/lib/commands/genTextOfLength.js.map +1 -0
  17. package/lib/commands/getAttribute.d.ts +20 -0
  18. package/lib/commands/getAttribute.js +22 -0
  19. package/lib/commands/getAttribute.js.map +1 -0
  20. package/lib/commands/getClassName.d.ts +15 -0
  21. package/lib/commands/getClassName.js +21 -0
  22. package/lib/commands/getClassName.js.map +1 -0
  23. package/lib/commands/getCurrentDateInfo.d.ts +21 -0
  24. package/lib/commands/getCurrentDateInfo.js +25 -0
  25. package/lib/commands/getCurrentDateInfo.js.map +1 -0
  26. package/lib/commands/getId.d.ts +15 -0
  27. package/lib/commands/getId.js +21 -0
  28. package/lib/commands/getId.js.map +1 -0
  29. package/lib/commands/getNumElements.d.ts +14 -0
  30. package/lib/commands/getNumElements.js +19 -0
  31. package/lib/commands/getNumElements.js.map +1 -0
  32. package/lib/commands/getSpecialChars.d.ts +14 -0
  33. package/lib/commands/getSpecialChars.js +16 -0
  34. package/lib/commands/getSpecialChars.js.map +1 -0
  35. package/lib/commands/getTitle.d.ts +13 -0
  36. package/lib/commands/getTitle.js +20 -0
  37. package/lib/commands/getTitle.js.map +1 -0
  38. package/lib/commands/handleHarvardKey.d.ts +18 -0
  39. package/lib/commands/handleHarvardKey.js +56 -0
  40. package/lib/commands/handleHarvardKey.js.map +1 -0
  41. package/lib/commands/handleHarvardKey2.d.ts +14 -0
  42. package/lib/commands/handleHarvardKey2.js +88 -0
  43. package/lib/commands/handleHarvardKey2.js.map +1 -0
  44. package/lib/commands/launchAs.d.ts +20 -0
  45. package/lib/commands/launchAs.js +60 -0
  46. package/lib/commands/launchAs.js.map +1 -0
  47. package/lib/commands/launchLTIUsingToken.d.ts +19 -0
  48. package/lib/commands/launchLTIUsingToken.js +74 -0
  49. package/lib/commands/launchLTIUsingToken.js.map +1 -0
  50. package/lib/commands/listSelectLabels.d.ts +15 -0
  51. package/lib/commands/listSelectLabels.js +24 -0
  52. package/lib/commands/listSelectLabels.js.map +1 -0
  53. package/lib/commands/listSelectValues.d.ts +15 -0
  54. package/lib/commands/listSelectValues.js +26 -0
  55. package/lib/commands/listSelectValues.js.map +1 -0
  56. package/lib/commands/navigateToHref.d.ts +19 -0
  57. package/lib/commands/navigateToHref.js +23 -0
  58. package/lib/commands/navigateToHref.js.map +1 -0
  59. package/lib/commands/padWithZeros.d.ts +20 -0
  60. package/lib/commands/padWithZeros.js +24 -0
  61. package/lib/commands/padWithZeros.js.map +1 -0
  62. package/lib/commands/runScript.d.ts +16 -0
  63. package/lib/commands/runScript.js +25 -0
  64. package/lib/commands/runScript.js.map +1 -0
  65. package/lib/commands/typeInto.d.ts +20 -0
  66. package/lib/commands/typeInto.js +28 -0
  67. package/lib/commands/typeInto.js.map +1 -0
  68. package/lib/commands/uniquify.d.ts +15 -0
  69. package/lib/commands/uniquify.js +25 -0
  70. package/lib/commands/uniquify.js.map +1 -0
  71. package/lib/commands/visitCanvasEndpoint.d.ts +27 -0
  72. package/lib/commands/visitCanvasEndpoint.js +35 -0
  73. package/lib/commands/visitCanvasEndpoint.js.map +1 -0
  74. package/lib/commands/visitCanvasGETEndpoint.d.ts +20 -0
  75. package/lib/commands/visitCanvasGETEndpoint.js +26 -0
  76. package/lib/commands/visitCanvasGETEndpoint.js.map +1 -0
  77. package/lib/commands/waitForAtLeastOneElementPresent.d.ts +23 -0
  78. package/lib/commands/waitForAtLeastOneElementPresent.js +27 -0
  79. package/lib/commands/waitForAtLeastOneElementPresent.js.map +1 -0
  80. package/lib/commands/waitForElementVisible.d.ts +14 -0
  81. package/lib/commands/waitForElementVisible.js +20 -0
  82. package/lib/commands/waitForElementVisible.js.map +1 -0
  83. package/lib/index.js.map +1 -0
  84. package/lib/init.d.ts +6 -0
  85. package/lib/init.js +69 -0
  86. package/lib/init.js.map +1 -0
  87. package/lib/setup/checkRequiredFiles/index.js +7 -0
  88. package/lib/setup/checkRequiredFiles/index.js.map +1 -1
  89. package/lib/src/commands/extractDataFromClass.d.ts +7 -4
  90. package/lib/src/commands/extractDataFromClass.js +2 -1
  91. package/lib/src/commands/extractDataFromClass.js.map +1 -1
  92. package/lib/src/commands/extractDataFromClassByContents.d.ts +9 -5
  93. package/lib/src/commands/extractDataFromClassByContents.js +2 -1
  94. package/lib/src/commands/extractDataFromClassByContents.js.map +1 -1
  95. package/lib/src/commands/genTextOfLength.d.ts +20 -0
  96. package/lib/src/commands/genTextOfLength.js +20 -0
  97. package/lib/src/commands/genTextOfLength.js.map +1 -0
  98. package/lib/src/commands/getAttribute.d.ts +20 -0
  99. package/lib/src/commands/getAttribute.js +22 -0
  100. package/lib/src/commands/getAttribute.js.map +1 -0
  101. package/lib/src/commands/getClassName.d.ts +15 -0
  102. package/lib/src/commands/getClassName.js +21 -0
  103. package/lib/src/commands/getClassName.js.map +1 -0
  104. package/lib/src/commands/getCurrentDateInfo.d.ts +21 -0
  105. package/lib/src/commands/getCurrentDateInfo.js +25 -0
  106. package/lib/src/commands/getCurrentDateInfo.js.map +1 -0
  107. package/lib/src/commands/getId.d.ts +15 -0
  108. package/lib/src/commands/getId.js +21 -0
  109. package/lib/src/commands/getId.js.map +1 -0
  110. package/lib/src/commands/getJSON.d.ts +0 -1
  111. package/lib/src/commands/getJSON.js +1 -4
  112. package/lib/src/commands/getJSON.js.map +1 -1
  113. package/lib/src/commands/getSpecialChars.d.ts +14 -0
  114. package/lib/src/commands/getSpecialChars.js +16 -0
  115. package/lib/src/commands/getSpecialChars.js.map +1 -0
  116. package/lib/src/commands/getTitle.d.ts +13 -0
  117. package/lib/src/commands/getTitle.js +20 -0
  118. package/lib/src/commands/getTitle.js.map +1 -0
  119. package/lib/src/commands/index.js +29 -5
  120. package/lib/src/commands/index.js.map +1 -1
  121. package/lib/src/commands/launchLTIUsingToken.js +12 -4
  122. package/lib/src/commands/launchLTIUsingToken.js.map +1 -1
  123. package/lib/src/commands/listSelectLabels.d.ts +15 -0
  124. package/lib/src/commands/listSelectLabels.js +24 -0
  125. package/lib/src/commands/listSelectLabels.js.map +1 -0
  126. package/lib/src/commands/listSelectValues.d.ts +15 -0
  127. package/lib/src/commands/listSelectValues.js +27 -0
  128. package/lib/src/commands/listSelectValues.js.map +1 -0
  129. package/lib/src/commands/padWithZeros.d.ts +20 -0
  130. package/lib/src/commands/padWithZeros.js +24 -0
  131. package/lib/src/commands/padWithZeros.js.map +1 -0
  132. package/lib/src/commands/uniquify.d.ts +15 -0
  133. package/lib/src/commands/uniquify.js +26 -0
  134. package/lib/src/commands/uniquify.js.map +1 -0
  135. package/lib/src/commands/visitCanvasEndpoint.d.ts +26 -0
  136. package/lib/src/commands/visitCanvasEndpoint.js +36 -0
  137. package/lib/src/commands/visitCanvasEndpoint.js.map +1 -0
  138. package/lib/src/commands/waitForAtLeastOneElementPresent.d.ts +23 -0
  139. package/lib/src/commands/waitForAtLeastOneElementPresent.js +28 -0
  140. package/lib/src/commands/waitForAtLeastOneElementPresent.js.map +1 -0
  141. package/lib/src/genConfiguration/index.js +21 -3
  142. package/lib/src/genConfiguration/index.js.map +1 -1
  143. package/lib/src/init.js +28 -2
  144. package/lib/src/init.js.map +1 -1
  145. package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.d.ts +6 -0
  146. package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js +9 -0
  147. package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js.map +1 -0
  148. package/lib/start/helpers/collectPngFiles.d.ts +9 -0
  149. package/lib/start/helpers/collectPngFiles.js +31 -0
  150. package/lib/start/helpers/collectPngFiles.js.map +1 -0
  151. package/lib/start/helpers/executeAllHeadlessCombinations.d.ts +15 -0
  152. package/lib/start/helpers/executeAllHeadlessCombinations.js +116 -0
  153. package/lib/start/helpers/executeAllHeadlessCombinations.js.map +1 -0
  154. package/lib/start/helpers/executeCypress.d.ts +17 -0
  155. package/lib/start/helpers/executeCypress.js +103 -0
  156. package/lib/start/helpers/executeCypress.js.map +1 -0
  157. package/lib/start/helpers/generateHtmlReport.d.ts +14 -0
  158. package/lib/start/helpers/generateHtmlReport.js +54 -0
  159. package/lib/start/helpers/generateHtmlReport.js.map +1 -0
  160. package/lib/start/helpers/generateReportHomepage.d.ts +9 -0
  161. package/lib/start/helpers/generateReportHomepage.js +142 -0
  162. package/lib/start/helpers/generateReportHomepage.js.map +1 -0
  163. package/lib/start/helpers/generateReporterConfig.d.ts +17 -0
  164. package/lib/start/helpers/generateReporterConfig.js +32 -0
  165. package/lib/start/helpers/generateReporterConfig.js.map +1 -0
  166. package/lib/start/helpers/getDateLabeledDir.d.ts +7 -0
  167. package/lib/start/helpers/getDateLabeledDir.js +38 -0
  168. package/lib/start/helpers/getDateLabeledDir.js.map +1 -0
  169. package/lib/start/helpers/mergeAllReportsAndGenerateHtml.d.ts +11 -0
  170. package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js +121 -0
  171. package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js.map +1 -0
  172. package/lib/start/helpers/mergeReports.d.ts +14 -0
  173. package/lib/start/helpers/mergeReports.js +63 -0
  174. package/lib/start/helpers/mergeReports.js.map +1 -0
  175. package/lib/start/helpers/reportHomepage.ejs +272 -0
  176. package/lib/start/helpers/runCypressHeadless.d.ts +18 -0
  177. package/lib/start/helpers/runCypressHeadless.js +138 -0
  178. package/lib/start/helpers/runCypressHeadless.js.map +1 -0
  179. package/lib/start/helpers/runCypressVisible.d.ts +8 -0
  180. package/lib/start/helpers/runCypressVisible.js +53 -0
  181. package/lib/start/helpers/runCypressVisible.js.map +1 -0
  182. package/lib/start/index.js +23 -5
  183. package/lib/start/index.js.map +1 -1
  184. package/lib/start/types/MochawesomeReporterConfig.d.ts +15 -0
  185. package/lib/start/types/MochawesomeReporterConfig.js +3 -0
  186. package/lib/start/types/MochawesomeReporterConfig.js.map +1 -0
  187. package/lib/start/types/Profile.d.ts +9 -0
  188. package/lib/start/types/Profile.js +3 -0
  189. package/lib/start/types/Profile.js.map +1 -0
  190. package/lib/start/types/ReportInfo.d.ts +14 -0
  191. package/lib/start/types/ReportInfo.js +3 -0
  192. package/lib/start/types/ReportInfo.js.map +1 -0
  193. package/lib/start/types/RunResult.d.ts +12 -0
  194. package/lib/start/types/RunResult.js +3 -0
  195. package/lib/start/types/RunResult.js.map +1 -0
  196. package/lib/start/types/ScreenshotInfo.d.ts +10 -0
  197. package/lib/start/types/ScreenshotInfo.js +3 -0
  198. package/lib/start/types/ScreenshotInfo.js.map +1 -0
  199. package/lib/start/types/TemplateReportInfo.d.ts +12 -0
  200. package/lib/start/types/TemplateReportInfo.js +3 -0
  201. package/lib/start/types/TemplateReportInfo.js.map +1 -0
  202. package/package.json +10 -8
  203. package/setup/checkRequiredFiles/index.ts +7 -0
  204. package/src/commands/extractDataFromClass.ts +17 -6
  205. package/src/commands/extractDataFromClassByContents.ts +21 -8
  206. package/src/commands/genTextOfLength.ts +54 -0
  207. package/src/commands/getAttribute.ts +58 -0
  208. package/src/commands/getClassName.ts +44 -0
  209. package/src/commands/getCurrentDateInfo.ts +57 -0
  210. package/src/commands/getId.ts +44 -0
  211. package/src/commands/getJSON.ts +0 -4
  212. package/src/commands/getSpecialChars.ts +34 -0
  213. package/src/commands/getTitle.ts +39 -0
  214. package/src/commands/index.ts +29 -5
  215. package/src/commands/launchLTIUsingToken.ts +12 -4
  216. package/src/commands/listSelectLabels.ts +47 -0
  217. package/src/commands/listSelectValues.ts +50 -0
  218. package/src/commands/padWithZeros.ts +53 -0
  219. package/src/commands/uniquify.ts +49 -0
  220. package/src/commands/visitCanvasEndpoint.ts +75 -0
  221. package/src/commands/waitForAtLeastOneElementPresent.ts +64 -0
  222. package/src/genConfiguration/index.ts +20 -2
  223. package/start/constants/DEFAULT_THREADS_PER_COMBO.ts +7 -0
  224. package/start/helpers/collectPngFiles.ts +25 -0
  225. package/start/helpers/executeAllHeadlessCombinations.ts +92 -0
  226. package/start/helpers/executeCypress.ts +66 -0
  227. package/start/helpers/generateHtmlReport.ts +71 -0
  228. package/start/helpers/generateReportHomepage.ts +148 -0
  229. package/start/helpers/generateReporterConfig.ts +39 -0
  230. package/start/helpers/getDateLabeledDir.ts +43 -0
  231. package/start/helpers/mergeAllReportsAndGenerateHtml.ts +150 -0
  232. package/start/helpers/mergeReports.ts +82 -0
  233. package/start/helpers/reportHomepage.ejs +272 -0
  234. package/start/helpers/runCypressHeadless.ts +164 -0
  235. package/start/helpers/runCypressVisible.ts +45 -0
  236. package/start/index.ts +23 -5
  237. package/start/types/MochawesomeReporterConfig.ts +23 -0
  238. package/start/types/Profile.ts +12 -0
  239. package/start/types/ReportInfo.ts +22 -0
  240. package/start/types/RunResult.ts +18 -0
  241. package/start/types/ScreenshotInfo.ts +13 -0
  242. package/start/types/TemplateReportInfo.ts +16 -0
  243. package/src/commands/visitCanvasGETEndpoint.ts +0 -61
@@ -0,0 +1,20 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Type text into an element. This function first removes the previous text in the element
6
+ * @param opts object containing all arguments
7
+ * @param opts.item the CSS selector of interest
8
+ * @param opts.text the text to type
9
+ * @param opts.pressEnter if true, after typing into the text field, simulate pressing enter
10
+ */
11
+ typeInto(opts: {
12
+ item: string;
13
+ text: string;
14
+ pressEnter?: boolean;
15
+ }): Chainable<Element>;
16
+ }
17
+ }
18
+ }
19
+ declare const typeInto: () => void;
20
+ export default typeInto;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*----------------------------------------*/
5
+ /* --------------- Command -------------- */
6
+ /*----------------------------------------*/
7
+ var typeInto = function () {
8
+ Cypress.Commands.add('typeInto', function (opts) {
9
+ var item = opts.item, text = opts.text, pressEnter = opts.pressEnter;
10
+ cy.log("Type \"".concat(text, "\" into ").concat(item));
11
+ // Check if the text contains an enter key press
12
+ var enterAtEndOfText = text.charAt(text.length - 1) === '\n';
13
+ // Type the text without a trailing enter if there was one
14
+ var textWithoutTrailingEnter = enterAtEndOfText
15
+ ? text.substring(0, text.length - 1)
16
+ : text;
17
+ cy.get(item).clear().type(textWithoutTrailingEnter);
18
+ // Press enter if explicitly requested or if text ended with newline
19
+ if (pressEnter || enterAtEndOfText) {
20
+ cy.get(item).type('{enter}');
21
+ }
22
+ });
23
+ };
24
+ /*----------------------------------------*/
25
+ /* --------------- Export --------------- */
26
+ /*----------------------------------------*/
27
+ exports.default = typeInto;
28
+ //# sourceMappingURL=typeInto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeInto.js","sourceRoot":"","sources":["../../src/commands/typeInto.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAyBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,QAAQ,GAAG;IACf,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,UAAU,EACV,UACE,IAIC;QAEK,IAAA,IAAI,GAAuB,IAAI,KAA3B,EAAE,IAAI,GAAiB,IAAI,KAArB,EAAE,UAAU,GAAK,IAAI,WAAT,CAAU;QACxC,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,gBAAgB;YAC/C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YACpC,CAAC,CAAC,IAAI,CAAC;QAET,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAEpD,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,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1,15 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Makes a string unique by appending a timestamp and a counter.
6
+ * @author Allison Zhang
7
+ * @param text the original string
8
+ * @returns the uniquified string
9
+ */
10
+ uniquify(text: string): string;
11
+ }
12
+ }
13
+ }
14
+ declare const uniquify: () => void;
15
+ export default uniquify;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*----------------------------------------*/
5
+ /* --------------- Helpers -------------- */
6
+ /*----------------------------------------*/
7
+ var uniqueCounter = 1;
8
+ var shorten = function (num) {
9
+ return Number(num).toString(36);
10
+ };
11
+ var id = shorten(Math.floor(Math.random() * 10000));
12
+ /*----------------------------------------*/
13
+ /* --------------- Command -------------- */
14
+ /*----------------------------------------*/
15
+ var uniquify = function () {
16
+ Cypress.Commands.add('uniquify', function (text) {
17
+ var thisCounter = uniqueCounter++;
18
+ return "".concat(text, " [").concat(shorten(Number.parseInt("".concat(Date.now()).concat(thisCounter).concat(id), 10)), "]");
19
+ });
20
+ };
21
+ /*----------------------------------------*/
22
+ /* --------------- Export --------------- */
23
+ /*----------------------------------------*/
24
+ exports.default = uniquify;
25
+ //# sourceMappingURL=uniquify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uniquify.js","sourceRoot":"","sources":["../../src/commands/uniquify.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAoBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB,IAAM,OAAO,GAAG,UAAC,GAAW;IAC1B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,IAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;AAEtD,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,QAAQ,GAAG;IACf,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,UAAC,IAAY;QAC5C,IAAM,WAAW,GAAG,aAAa,EAAE,CAAC;QACpC,OAAO,UAAG,IAAI,eAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAG,IAAI,CAAC,GAAG,EAAE,SAAG,WAAW,SAAG,EAAE,CAAE,EAAE,EAAE,CAAC,CAAC,MAAG,CAAC;IACzF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1,27 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Send a request to a Canvas API endpoint.
6
+ * @author Allison Zhang
7
+ * @param opts options object
8
+ * @param opts.method the HTTP method (e.g., 'GET', 'POST', 'DELETE')
9
+ * @param opts.path the API endpoint path excluding 'https://canvas.harvard.edu', (e.g., '/api/v1/courses/123')
10
+ * @param opts.accessToken the access token for authentication
11
+ * @param opts.params the request params (if any)
12
+ * @returns response body
13
+ * @example cy.visitCanvasEndpoint({ method: 'POST', path, accessToken, params }).then((res) => { ... })
14
+ */
15
+ visitCanvasEndpoint(opts: {
16
+ method: string;
17
+ path: string;
18
+ accessToken: string;
19
+ params?: {
20
+ [k: string]: any;
21
+ };
22
+ }): Chainable<any>;
23
+ }
24
+ }
25
+ }
26
+ declare const visitCanvasEndpoint: () => void;
27
+ export default visitCanvasEndpoint;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ /*----------------------------------------*/
16
+ /* --------------- Command -------------- */
17
+ /*----------------------------------------*/
18
+ var visitCanvasEndpoint = function () {
19
+ Cypress.Commands.add('visitCanvasEndpoint', function (opts) {
20
+ return (cy
21
+ .request({
22
+ method: opts.method,
23
+ url: 'https://canvas.harvard.edu' + opts.path,
24
+ body: __assign(__assign({}, (opts.params || {})), { access_token: opts.accessToken }),
25
+ })
26
+ .then(function (response) {
27
+ return response.body;
28
+ }));
29
+ });
30
+ };
31
+ /*----------------------------------------*/
32
+ /* --------------- Export --------------- */
33
+ /*----------------------------------------*/
34
+ exports.default = visitCanvasEndpoint;
35
+ //# sourceMappingURL=visitCanvasEndpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visitCanvasEndpoint.js","sourceRoot":"","sources":["../../src/commands/visitCanvasEndpoint.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;;;;;;;;;;;AAgCjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,mBAAmB,GAAG;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,EAAE,UAC1C,IAOC;QACD,OAAO,CACL,EAAE;aACC,OAAO,CAAC;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,EAAE,4BAA4B,GAAG,IAAI,CAAC,IAAI;YAC7C,IAAI,wBACC,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,KACtB,YAAY,EAAE,IAAI,CAAC,WAAW,GAC/B;SACF,CAAC;aACH,IAAI,CAAC,UAAC,QAAQ;YACb,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,mBAAmB,CAAC"}
@@ -0,0 +1,20 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Makes a GET request to Canvas API endpoint
6
+ * @param opts object containing all arguments
7
+ * @param opts.path The API path (e.g., '/courses', '/users/self')
8
+ * @param opts.accessToken The Canvas access token
9
+ * @returns The API response body
10
+ * @example cy.visitCanvasGETEndpoint({ path: '/courses', accessToken: 'your_token' })
11
+ */
12
+ visitCanvasGETEndpoint(opts: {
13
+ path: string;
14
+ accessToken: string;
15
+ }): Chainable<any>;
16
+ }
17
+ }
18
+ }
19
+ declare const visitCanvasGETEndpoint: () => void;
20
+ export default visitCanvasGETEndpoint;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*----------------------------------------*/
5
+ /* --------------- Command -------------- */
6
+ /*----------------------------------------*/
7
+ var visitCanvasGETEndpoint = function () {
8
+ Cypress.Commands.add('visitCanvasGETEndpoint', function (opts) {
9
+ cy.log('Visiting Canvas GET endpoint');
10
+ var path = opts.path, accessToken = opts.accessToken;
11
+ cy.log('Canvas API: ' + path);
12
+ return cy.request({
13
+ method: 'GET',
14
+ url: 'https://canvas.harvard.edu/api/v1' + path,
15
+ qs: {
16
+ per_page: 200,
17
+ access_token: accessToken
18
+ }
19
+ }).its('body');
20
+ });
21
+ };
22
+ /*----------------------------------------*/
23
+ /* --------------- Export --------------- */
24
+ /*----------------------------------------*/
25
+ exports.default = visitCanvasGETEndpoint;
26
+ //# sourceMappingURL=visitCanvasGETEndpoint.js.map
@@ -0,0 +1 @@
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;QAEH,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,cAAc,GAAG,IAAI,CAAC,CAAC;QAC9B,OAAO,EAAE,CAAC,OAAO,CAAC;YAChB,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,mCAAmC,GAAG,IAAI;YAC/C,EAAE,EAAE;gBACF,QAAQ,EAAE,GAAG;gBACb,YAAY,EAAE,WAAW;aAC1B;SACF,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,sBAAsB,CAAC"}
@@ -0,0 +1,23 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Wait for any element in a list to be present (check every tenth
6
+ * of a second for status)
7
+ * @author Gardenia Liu
8
+ * @param opts object containing all arguments
9
+ * @param opts.items list of CSS selectors of interest
10
+ * @param [opts.timeoutSec] the number of seconds to wait before
11
+ * timing out
12
+ * @returns the selector of the item that was found first, ties
13
+ * broken by which item shows up in the list first
14
+ */
15
+ waitForAtLeastOneElementPresent(opts: {
16
+ items: string[];
17
+ timeoutSec?: number;
18
+ }): Chainable<string>;
19
+ }
20
+ }
21
+ }
22
+ declare const waitForAtLeastOneElementPresent: () => void;
23
+ export default waitForAtLeastOneElementPresent;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*----------------------------------------*/
5
+ /* --------------- Command -------------- */
6
+ /*----------------------------------------*/
7
+ var waitForAtLeastOneElementPresent = function () {
8
+ Cypress.Commands.add('waitForAtLeastOneElementPresent', function (opts) {
9
+ // Set timeout seconds to 10 if not specified
10
+ var timeoutMs = (opts.timeoutSec || 10) * 1000;
11
+ // Combined selector for all items
12
+ var combinedSelector = opts.items.join(', ');
13
+ // Wait for any of the elements to be visible
14
+ return (cy
15
+ .get(combinedSelector, { timeout: timeoutMs })
16
+ .should(function ($els) { return expect($els.is(':visible'), "at least one of [".concat(combinedSelector, "] visible")).to.be.true; })
17
+ .then(function ($els) {
18
+ var $firstVisible = $els.filter(':visible').first();
19
+ return opts.items.find(function (sel) { return $firstVisible.is(sel); });
20
+ }));
21
+ });
22
+ };
23
+ /*----------------------------------------*/
24
+ /* --------------- Export --------------- */
25
+ /*----------------------------------------*/
26
+ exports.default = waitForAtLeastOneElementPresent;
27
+ //# sourceMappingURL=waitForAtLeastOneElementPresent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForAtLeastOneElementPresent.js","sourceRoot":"","sources":["../../src/commands/waitForAtLeastOneElementPresent.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA8BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,+BAA+B,GAAG;IACtC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,iCAAiC,EACjC,UAAC,IAA8C;QAC7C,6CAA6C;QAC7C,IAAM,SAAS,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QAEjD,kCAAkC;QAClC,IAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/C,6CAA6C;QAC7C,OAAO,CACL,EAAE;aACC,GAAG,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;aAC7C,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,2BAAoB,gBAAgB,cAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAvF,CAAuF,CAAC;aACvG,IAAI,CAAC,UAAA,IAAI;YACR,IAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;YACtD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,aAAa,CAAC,EAAE,CAAC,GAAG,CAAC,EAArB,CAAqB,CAAC,CAAC;QACvD,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,+BAA+B,CAAC"}
@@ -0,0 +1,14 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Wait for an element to be visible
6
+ * @param item the CSS selector of interest
7
+ * @param timeoutSec the number of seconds to wait before timing out (default: 10)
8
+ */
9
+ waitForElementVisible(item: string, timeoutSec?: number): Chainable<JQuery<HTMLElement>>;
10
+ }
11
+ }
12
+ }
13
+ declare const waitForElementVisible: () => void;
14
+ export default waitForElementVisible;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*----------------------------------------*/
5
+ /* --------------- Command -------------- */
6
+ /*----------------------------------------*/
7
+ var waitForElementVisible = function () {
8
+ Cypress.Commands.add('waitForElementVisible', function (item, timeoutSec) {
9
+ cy.log('Waiting for element to be visible');
10
+ timeoutSec = timeoutSec || 10;
11
+ var timeoutMs = timeoutSec * 1000;
12
+ cy.log("Wait for ".concat(item, " to be visible"));
13
+ return cy.get(item, { timeout: timeoutMs }).should('be.visible');
14
+ });
15
+ };
16
+ /*----------------------------------------*/
17
+ /* --------------- Export --------------- */
18
+ /*----------------------------------------*/
19
+ exports.default = waitForElementVisible;
20
+ //# sourceMappingURL=waitForElementVisible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForElementVisible.js","sourceRoot":"","sources":["../../src/commands/waitForElementVisible.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AAsBjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,qBAAqB,GAAG;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAClB,uBAAuB,EACvB,UACE,IAAY,EACZ,UAAmB;QAErB,EAAE,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;QAC5C,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;QAE9B,IAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC;QACpC,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,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,iBAAiB;AACjB,gDAA0B;AASxB,eATK,cAAI,CASL;AARN,wEAAkD;AAOhD,2BAPK,0BAAgB,CAOL;AALlB,sDAAsD;AACtD,IAAA,cAAI,GAAE,CAAC"}
package/lib/init.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Initialize custom commands
3
+ * @author Gabe Abrams
4
+ */
5
+ declare const init: () => void;
6
+ export default init;
package/lib/init.js ADDED
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ // Import all commands
7
+ var assertDoesNotHaveClass_1 = __importDefault(require("./commands/assertDoesNotHaveClass"));
8
+ var assertHasClass_1 = __importDefault(require("./commands/assertHasClass"));
9
+ var assertNumElements_1 = __importDefault(require("./commands/assertNumElements"));
10
+ var clickWithRetry_1 = __importDefault(require("./commands/clickWithRetry"));
11
+ var getNumElements_1 = __importDefault(require("./commands/getNumElements"));
12
+ var handleHarvardKey_1 = __importDefault(require("./commands/handleHarvardKey"));
13
+ var launchAs_1 = __importDefault(require("./commands/launchAs"));
14
+ var launchLTIUsingToken_1 = __importDefault(require("./commands/launchLTIUsingToken"));
15
+ var navigateToHref_1 = __importDefault(require("./commands/navigateToHref"));
16
+ var runScript_1 = __importDefault(require("./commands/runScript"));
17
+ var typeInto_1 = __importDefault(require("./commands/typeInto"));
18
+ var waitForElementVisible_1 = __importDefault(require("./commands/waitForElementVisible"));
19
+ // New commands
20
+ var genTextOfLength_1 = __importDefault(require("./commands/genTextOfLength"));
21
+ var getSpecialChars_1 = __importDefault(require("./commands/getSpecialChars"));
22
+ var uniquify_1 = __importDefault(require("./commands/uniquify"));
23
+ var getAttribute_1 = __importDefault(require("./commands/getAttribute"));
24
+ var getClassName_1 = __importDefault(require("./commands/getClassName"));
25
+ var getId_1 = __importDefault(require("./commands/getId"));
26
+ var getCurrentDateInfo_1 = __importDefault(require("./commands/getCurrentDateInfo"));
27
+ var getCurrentDateInfo_2 = __importDefault(require("./commands/getCurrentDateInfo"));
28
+ var getTitle_1 = __importDefault(require("./commands/getTitle"));
29
+ var listSelectLabels_1 = __importDefault(require("./commands/listSelectLabels"));
30
+ var listSelectValues_1 = __importDefault(require("./commands/listSelectValues"));
31
+ var padWithZeros_1 = __importDefault(require("./commands/padWithZeros"));
32
+ var visitCanvasEndpoint_1 = __importDefault(require("./commands/visitCanvasEndpoint"));
33
+ var waitForAtLeastOneElementPresent_1 = __importDefault(require("./commands/waitForAtLeastOneElementPresent"));
34
+ /**
35
+ * Initialize custom commands
36
+ * @author Gabe Abrams
37
+ */
38
+ var init = function () {
39
+ // Execute each command adder
40
+ (0, assertDoesNotHaveClass_1.default)();
41
+ (0, assertHasClass_1.default)();
42
+ (0, assertNumElements_1.default)();
43
+ (0, clickWithRetry_1.default)();
44
+ (0, getNumElements_1.default)();
45
+ (0, handleHarvardKey_1.default)();
46
+ (0, launchAs_1.default)();
47
+ (0, launchLTIUsingToken_1.default)();
48
+ (0, navigateToHref_1.default)();
49
+ (0, runScript_1.default)();
50
+ (0, typeInto_1.default)();
51
+ (0, waitForElementVisible_1.default)();
52
+ // New commands
53
+ (0, genTextOfLength_1.default)();
54
+ (0, getSpecialChars_1.default)();
55
+ (0, uniquify_1.default)();
56
+ (0, getAttribute_1.default)();
57
+ (0, getClassName_1.default)();
58
+ (0, getId_1.default)();
59
+ (0, getCurrentDateInfo_1.default)();
60
+ (0, getCurrentDateInfo_2.default)();
61
+ (0, getTitle_1.default)();
62
+ (0, listSelectLabels_1.default)();
63
+ (0, listSelectValues_1.default)();
64
+ (0, padWithZeros_1.default)();
65
+ (0, visitCanvasEndpoint_1.default)();
66
+ (0, waitForAtLeastOneElementPresent_1.default)();
67
+ };
68
+ exports.default = init;
69
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;AAAA,sBAAsB;AACtB,6FAAuE;AACvE,6EAAuD;AACvD,mFAA6D;AAC7D,6EAAuD;AACvD,6EAAuD;AACvD,iFAA2D;AAC3D,iEAA2C;AAC3C,uFAAiE;AACjE,6EAAuD;AACvD,mEAA6C;AAC7C,iEAA2C;AAC3C,2FAAqE;AAErE,eAAe;AACf,+EAAyD;AACzD,+EAAyD;AACzD,iEAA2C;AAC3C,yEAAmD;AACnD,yEAAmD;AACnD,2DAAqC;AACrC,qFAA+D;AAC/D,qFAA0D;AAC1D,iEAA2C;AAC3C,iFAA2D;AAC3D,iFAA2D;AAC3D,yEAAmD;AACnD,uFAAiE;AACjE,+GAAyF;AAEzF;;;GAGG;AACH,IAAM,IAAI,GAAG;IACX,6BAA6B;IAC7B,IAAA,gCAAsB,GAAE,CAAC;IACzB,IAAA,wBAAc,GAAE,CAAC;IACjB,IAAA,2BAAiB,GAAE,CAAC;IACpB,IAAA,wBAAc,GAAE,CAAC;IACjB,IAAA,wBAAc,GAAE,CAAC;IACjB,IAAA,0BAAgB,GAAE,CAAC;IACnB,IAAA,kBAAQ,GAAE,CAAC;IACX,IAAA,6BAAmB,GAAE,CAAC;IACtB,IAAA,wBAAc,GAAE,CAAC;IACjB,IAAA,mBAAS,GAAE,CAAC;IACZ,IAAA,kBAAQ,GAAE,CAAC;IACX,IAAA,+BAAqB,GAAE,CAAC;IAExB,eAAe;IACf,IAAA,yBAAe,GAAE,CAAC;IAClB,IAAA,yBAAe,GAAE,CAAC;IAClB,IAAA,kBAAQ,GAAE,CAAC;IACX,IAAA,sBAAY,GAAE,CAAC;IACf,IAAA,sBAAY,GAAE,CAAC;IACf,IAAA,eAAK,GAAE,CAAC;IACR,IAAA,4BAAkB,GAAE,CAAC;IACrB,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,kBAAQ,GAAE,CAAC;IACX,IAAA,0BAAgB,GAAE,CAAC;IACnB,IAAA,0BAAgB,GAAE,CAAC;IACnB,IAAA,sBAAY,GAAE,CAAC;IACf,IAAA,6BAAmB,GAAE,CAAC;IACtB,IAAA,yCAA+B,GAAE,CAAC;AACpC,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
@@ -26,6 +26,7 @@ var checkRequiredFiles = function () {
26
26
  ];
27
27
  // Determine profile file name (default is stage)
28
28
  var profileName = process.env.CYPRESS_PROFILE || 'Stage';
29
+ var defaultProfileName = 'Default';
29
30
  var requiredProfile = "".concat(profileName, ".Profile.ts");
30
31
  // Check global files
31
32
  requiredGlobals.forEach(function (globalName) {
@@ -42,6 +43,12 @@ var checkRequiredFiles = function () {
42
43
  if (!profileFound) {
43
44
  (0, genEmptyProfileFile_1.default)(profileName);
44
45
  }
46
+ // Check default profile file
47
+ var defaultProfileFilePath = path_1.default.join(profilesPath, "".concat(defaultProfileName, ".Profile.ts"));
48
+ var defaultProfileFound = (0, fs_1.existsSync)(defaultProfileFilePath);
49
+ if (!defaultProfileFound) {
50
+ (0, genEmptyProfileFile_1.default)(defaultProfileName);
51
+ }
45
52
  };
46
53
  exports.default = checkRequiredFiles;
47
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../setup/checkRequiredFiles/index.ts"],"names":[],"mappings":";;;;;AAAA,cAAc;AACd,yBAAgC;AAChC,8CAAwB;AAExB,wBAAwB;AACxB,uEAAiD;AACjD,4EAAsD;AACtD,8EAAwD;AAExD;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,IAAM,IAAI,GAAG,IAAA,qBAAW,GAAE,CAAC;IAE3B,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;IAC/D,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,IAAA,6BAAmB,EAAC,kBAAkB,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -5,12 +5,15 @@ declare global {
5
5
  * Obtain data from a class attribute that starts with a specific prefix
6
6
  * and return it
7
7
  * @author Allison Zhang
8
- * @param selector the css selector for finding the element
9
- * @param classPrefix the prefix to look for in the class attribute
8
+ * @param opts the options object
9
+ * @param opts.selector the css selector for finding the element
10
+ * @param opts.classPrefix the prefix to look for in the class attribute
10
11
  * @returns the extracted data
11
- * @example cy.extractDataFromClass('.item', 'data-').then((data) => { ... })
12
12
  */
13
- extractDataFromClass(selector: string, classPrefix: string): Chainable<string[]>;
13
+ extractDataFromClass(opts: {
14
+ selector: string;
15
+ classPrefix: string;
16
+ }): Chainable<string[]>;
14
17
  }
15
18
  }
16
19
  }
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  /* --------------- Command -------------- */
6
6
  /*----------------------------------------*/
7
7
  var extractDataFromClass = function () {
8
- Cypress.Commands.add('extractDataFromClass', function (selector, classPrefix) {
8
+ Cypress.Commands.add('extractDataFromClass', function (opts) {
9
+ var selector = opts.selector, classPrefix = opts.classPrefix;
9
10
  return (cy
10
11
  .get(selector)
11
12
  .invoke('attr', 'class')
@@ -1 +1 @@
1
- {"version":3,"file":"extractDataFromClass.js","sourceRoot":"","sources":["../../../src/commands/extractDataFromClass.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA0BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,oBAAoB,GAAG;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,sBAAsB,EAAE,UAAC,QAAgB,EAAE,WAAmB;QACjF,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;aACvB,IAA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,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACtE,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,oBAAoB,CAAC"}
@@ -5,13 +5,17 @@ declare global {
5
5
  * Obtain data from a class attribute that starts with a specific prefix
6
6
  * and with specific contents, and return it
7
7
  * @author Allison Zhang
8
- * @param contents the contents of the element to find
9
- * @param selector the css selector for finding the element
10
- * @param classPrefix the prefix to look for in the class attribute
8
+ * @param opts the options object
9
+ * @param opts.contents the contents of the element to find
10
+ * @param opts.selector the css selector for finding the element
11
+ * @param opts.classPrefix the prefix to look for in the class attribute
11
12
  * @returns the extracted data
12
- * @example cy.extractDataFromClassByContents('Submit', '.button', 'btn-').then((data) => { ... })
13
13
  */
14
- extractDataFromClassByContents(contents: string, selector: string, classPrefix: string): Chainable<string[]>;
14
+ extractDataFromClassByContents(opts: {
15
+ contents: string;
16
+ selector: string;
17
+ classPrefix: string;
18
+ }): Chainable<string[]>;
15
19
  }
16
20
  }
17
21
  }
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  /* --------------- Command -------------- */
6
6
  /*----------------------------------------*/
7
7
  var extractDataFromClassByContents = function () {
8
- Cypress.Commands.add('extractDataFromClassByContents', function (contents, selector, classPrefix) {
8
+ Cypress.Commands.add('extractDataFromClassByContents', function (opts) {
9
+ var contents = opts.contents, selector = opts.selector, classPrefix = opts.classPrefix;
9
10
  return (cy
10
11
  .get(selector)
11
12
  .contains(contents)
@@ -1 +1 @@
1
- {"version":3,"file":"extractDataFromClassByContents.js","sourceRoot":"","sources":["../../../src/commands/extractDataFromClassByContents.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA4BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,8BAA8B,GAAG;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,EAAE,UAAC,QAAgB,EAAE,QAAgB,EAAE,WAAmB;QAC7G,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,QAAQ,CAAC,QAAQ,CAAC;aAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;aACvB,IAAI,CAAC,UAAC,SAAiB;YACtB,IAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACvC,IAAM,IAAI,GAAG,SAAS;iBACnB,MAAM,CAAC,UAAC,SAAS,IAAO,OAAO,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;iBACpE,GAAG,CAAC,UAAC,SAAS,IAAO,OAAO,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACtE,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,8BAA8B,CAAC"}
1
+ {"version":3,"file":"extractDataFromClassByContents.js","sourceRoot":"","sources":["../../../src/commands/extractDataFromClassByContents.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA8BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,8BAA8B,GAAG;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,gCAAgC,EAAE,UACrD,IAIC;QAGC,IAAA,QAAQ,GAGN,IAAI,SAHE,EACR,QAAQ,GAEN,IAAI,SAFE,EACR,WAAW,GACT,IAAI,YADK,CACJ;QACT,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,QAAQ,CAAC,QAAQ,CAAC;aAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;aACvB,IAAI,CAAC,UAAC,SAAiB;YACtB,IAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACvC,IAAM,IAAI,GAAG,SAAS;iBACnB,MAAM,CAAC,UAAC,SAAS,IAAO,OAAO,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;iBACpE,GAAG,CAAC,UAAC,SAAS,IAAO,OAAO,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACtE,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,8BAA8B,CAAC"}
@@ -0,0 +1,20 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Generate a string of specified length for Cypress tests
6
+ * @author Gardenia Liu, Allison Zhang
7
+ * @param opts options object
8
+ * @param opts.length the desired length of the string
9
+ * @param opts.text optional text to repeat to form the string; defaults to '123456789x' if not provided
10
+ * @returns a string of the specified length, if the length is not a multiple of the text length, it is truncated
11
+ */
12
+ genTextOfLength(opts: {
13
+ length: number;
14
+ text?: string;
15
+ }): Chainable<string>;
16
+ }
17
+ }
18
+ }
19
+ declare const genTextOfLength: () => void;
20
+ export default genTextOfLength;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*----------------------------------------*/
5
+ /* --------------- Command -------------- */
6
+ /*----------------------------------------*/
7
+ var genTextOfLength = function () {
8
+ Cypress.Commands.add('genTextOfLength', function (opts) {
9
+ var length = opts.length, text = opts.text;
10
+ var textToUse = text || '123456789x';
11
+ var lengthOfTextToUse = Math.ceil(length / textToUse.length);
12
+ var result = textToUse.repeat(lengthOfTextToUse).substring(0, length);
13
+ return cy.wrap(result);
14
+ });
15
+ };
16
+ /*----------------------------------------*/
17
+ /* --------------- Export --------------- */
18
+ /*----------------------------------------*/
19
+ exports.default = genTextOfLength;
20
+ //# sourceMappingURL=genTextOfLength.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"genTextOfLength.js","sourceRoot":"","sources":["../../../src/commands/genTextOfLength.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA2BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,eAAe,GAAG;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE,UACtC,IAGC;QAGC,IAAA,MAAM,GAEJ,IAAI,OAFA,EACN,IAAI,GACF,IAAI,KADF,CACG;QACT,IAAM,SAAS,GAAG,IAAI,IAAI,YAAY,CAAC;QACvC,IAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAC/D,IAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACxE,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,kBAAe,eAAe,CAAC"}
@@ -0,0 +1,20 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Get the attribute of an element
6
+ * @author Allison Zhang
7
+ * @param opts options object
8
+ * @param opts.selector the CSS selector of the element
9
+ * @param opts.attribute the attribute to retrieve
10
+ * @returns the attribute of the element
11
+ */
12
+ getAttribute(opts: {
13
+ selector: string;
14
+ attribute: string;
15
+ }): Chainable<string>;
16
+ }
17
+ }
18
+ }
19
+ declare const getAttribute: () => void;
20
+ export default getAttribute;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /// <reference types="cypress" />
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*----------------------------------------*/
5
+ /* --------------- Command -------------- */
6
+ /*----------------------------------------*/
7
+ var getAttribute = function () {
8
+ Cypress.Commands.add('getAttribute', function (opts) {
9
+ var selector = opts.selector, attribute = opts.attribute;
10
+ return (cy
11
+ .get(selector)
12
+ .invoke('attr', attribute)
13
+ .then(function (attr) {
14
+ return attr;
15
+ }));
16
+ });
17
+ };
18
+ /*----------------------------------------*/
19
+ /* --------------- Export --------------- */
20
+ /*----------------------------------------*/
21
+ exports.default = getAttribute;
22
+ //# sourceMappingURL=getAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAttribute.js","sourceRoot":"","sources":["../../../src/commands/getAttribute.ts"],"names":[],"mappings":";AAAA,iCAAiC;;AA2BjC,4CAA4C;AAC5C,4CAA4C;AAC5C,4CAA4C;AAE5C,IAAM,YAAY,GAAG;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,UACnC,IAGC;QAGC,IAAA,QAAQ,GAEN,IAAI,SAFE,EACR,SAAS,GACP,IAAI,UADG,CACF;QACT,OAAO,CACL,EAAE;aACC,GAAG,CAAC,QAAQ,CAAC;aACb,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;aACzB,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"}