dceky 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/commands.html +961 -0
- package/genDocs/index.ts +322 -0
- package/lib/genDocs/index.d.ts +1 -0
- package/lib/genDocs/index.js +285 -0
- package/lib/genDocs/index.js.map +1 -0
- package/lib/postinstall/helpers/getRootPath.js +3 -3
- package/lib/postinstall/helpers/getRootPath.js.map +1 -1
- package/lib/postinstall/index.js +6 -6
- package/lib/postinstall/index.js.map +1 -1
- package/lib/preinstall/helpers/getRootPath.js +3 -3
- package/lib/preinstall/helpers/getRootPath.js.map +1 -1
- package/lib/preinstall/index.js +6 -6
- package/lib/preinstall/index.js.map +1 -1
- package/lib/setup/addToGitIgnore.js +13 -13
- package/lib/setup/addToGitIgnore.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genEmptyGlobalFile.js +12 -12
- package/lib/setup/checkRequiredFiles/genEmptyGlobalFile.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genEmptyProfileFile.js +12 -12
- package/lib/setup/checkRequiredFiles/genEmptyProfileFile.js.map +1 -1
- package/lib/setup/checkRequiredFiles/genExampleTest.js +8 -8
- package/lib/setup/checkRequiredFiles/genExampleTest.js.map +1 -1
- package/lib/setup/checkRequiredFiles/index.js +21 -21
- package/lib/setup/checkRequiredFiles/index.js.map +1 -1
- package/lib/setup/genCommandImportFile.js +24 -24
- package/lib/setup/genCommandImportFile.js.map +1 -1
- package/lib/setup/genDynamicConfigFile.js +8 -8
- package/lib/setup/genDynamicConfigFile.js.map +1 -1
- package/lib/setup/genE2ELaunchFile.js +9 -9
- package/lib/setup/genE2ELaunchFile.js.map +1 -1
- package/lib/setup/genKyCommandDeclarations.js +24 -24
- package/lib/setup/genKyCommandDeclarations.js.map +1 -1
- package/lib/setup/genTsConfigFile.d.ts +6 -0
- package/lib/setup/genTsConfigFile.js +51 -0
- package/lib/setup/genTsConfigFile.js.map +1 -0
- package/lib/setup/helpers/getRootPath.js +3 -3
- package/lib/setup/helpers/getRootPath.js.map +1 -1
- package/lib/setup/index.js +9 -7
- package/lib/setup/index.js.map +1 -1
- package/lib/setup/setupCypressDependencies.js +11 -11
- package/lib/setup/setupCypressDependencies.js.map +1 -1
- package/lib/src/commands/assertDoesNotHaveClass.js +3 -3
- package/lib/src/commands/assertDoesNotHaveClass.js.map +1 -1
- package/lib/src/commands/assertHasClass.js +3 -3
- package/lib/src/commands/assertHasClass.js.map +1 -1
- package/lib/src/commands/assertNumElements.js +3 -3
- package/lib/src/commands/assertNumElements.js.map +1 -1
- package/lib/src/commands/checkIfElementExists.js +3 -3
- package/lib/src/commands/checkIfElementExists.js.map +1 -1
- package/lib/src/commands/extractDataFromClass.js +8 -8
- package/lib/src/commands/extractDataFromClass.js.map +1 -1
- package/lib/src/commands/extractDataFromClassByContents.js +8 -8
- package/lib/src/commands/extractDataFromClassByContents.js.map +1 -1
- package/lib/src/commands/genTextOfLength.js +6 -6
- package/lib/src/commands/genTextOfLength.js.map +1 -1
- package/lib/src/commands/getAttribute.js +4 -4
- package/lib/src/commands/getAttribute.js.map +1 -1
- package/lib/src/commands/getClassName.js +3 -3
- package/lib/src/commands/getClassName.js.map +1 -1
- package/lib/src/commands/getCredentialValue.d.ts +1 -3
- package/lib/src/commands/getCredentialValue.js +3 -4
- package/lib/src/commands/getCredentialValue.js.map +1 -1
- package/lib/src/commands/getCredentialValues.js +2 -2
- package/lib/src/commands/getCredentialValues.js.map +1 -1
- package/lib/src/commands/getCurrentDateInfo.js +4 -4
- package/lib/src/commands/getCurrentDateInfo.js.map +1 -1
- package/lib/src/commands/getId.js +3 -3
- package/lib/src/commands/getId.js.map +1 -1
- package/lib/src/commands/getJSON.js +2 -2
- package/lib/src/commands/getJSON.js.map +1 -1
- package/lib/src/commands/getNumElements.js +4 -4
- package/lib/src/commands/getNumElements.js.map +1 -1
- package/lib/src/commands/getProfileValue.d.ts +2 -1
- package/lib/src/commands/getProfileValue.js +1 -1
- package/lib/src/commands/getProfileValue.js.map +1 -1
- package/lib/src/commands/getSpecialChars.js +2 -2
- package/lib/src/commands/getSpecialChars.js.map +1 -1
- package/lib/src/commands/getTitle.js +3 -3
- package/lib/src/commands/getTitle.js.map +1 -1
- package/lib/src/commands/handleHarvardKey.js +12 -12
- package/lib/src/commands/handleHarvardKey.js.map +1 -1
- package/lib/src/commands/helpers/getFormData.js +13 -13
- package/lib/src/commands/helpers/getFormData.js.map +1 -1
- package/lib/src/commands/index.js +34 -34
- package/lib/src/commands/index.js.map +1 -1
- package/lib/src/commands/launchAs.js +25 -26
- package/lib/src/commands/launchAs.js.map +1 -1
- package/lib/src/commands/listSelectLabels.js +6 -6
- package/lib/src/commands/listSelectLabels.js.map +1 -1
- package/lib/src/commands/listSelectValues.js +7 -7
- package/lib/src/commands/listSelectValues.js.map +1 -1
- package/lib/src/commands/logIntoPorta.js +21 -31
- package/lib/src/commands/logIntoPorta.js.map +1 -1
- package/lib/src/commands/navigateToHref.js +7 -7
- package/lib/src/commands/navigateToHref.js.map +1 -1
- package/lib/src/commands/padWithZeros.js +6 -6
- package/lib/src/commands/padWithZeros.js.map +1 -1
- package/lib/src/commands/runScript.js +4 -4
- package/lib/src/commands/runScript.js.map +1 -1
- package/lib/src/commands/tap.js +2 -2
- package/lib/src/commands/tap.js.map +1 -1
- package/lib/src/commands/tapInIFrame.js +2 -2
- package/lib/src/commands/tapInIFrame.js.map +1 -1
- package/lib/src/commands/typeInto.js +9 -9
- package/lib/src/commands/typeInto.js.map +1 -1
- package/lib/src/commands/uniquify.js +7 -7
- package/lib/src/commands/uniquify.js.map +1 -1
- package/lib/src/commands/visitCanvasEndpoint.js +7 -18
- package/lib/src/commands/visitCanvasEndpoint.js.map +1 -1
- package/lib/src/commands/waitForAtLeastOneElementPresent.js +9 -9
- package/lib/src/commands/waitForAtLeastOneElementPresent.js.map +1 -1
- package/lib/src/commands/waitForElementVisible.js +4 -4
- package/lib/src/commands/waitForElementVisible.js.map +1 -1
- package/lib/src/genConfiguration/helpers/getRootPath.js +3 -3
- package/lib/src/genConfiguration/helpers/getRootPath.js.map +1 -1
- package/lib/src/genConfiguration/helpers/resolveDependents.js +8 -9
- package/lib/src/genConfiguration/helpers/resolveDependents.js.map +1 -1
- package/lib/src/genConfiguration/helpers/splitEnv.js +5 -6
- package/lib/src/genConfiguration/helpers/splitEnv.js.map +1 -1
- package/lib/src/genConfiguration/index.js +36 -44
- package/lib/src/genConfiguration/index.js.map +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/start/constants/AVAILABLE_BROWSERS.js +1 -1
- package/lib/start/constants/AVAILABLE_BROWSERS.js.map +1 -1
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js +1 -1
- package/lib/start/constants/DEFAULT_THREADS_PER_COMBO.js.map +1 -1
- package/lib/start/helpers/collectPngFiles.js +8 -9
- package/lib/start/helpers/collectPngFiles.js.map +1 -1
- package/lib/start/helpers/exec.js +2 -2
- package/lib/start/helpers/exec.js.map +1 -1
- package/lib/start/helpers/executeAllHeadlessCombinations.js +58 -89
- package/lib/start/helpers/executeAllHeadlessCombinations.js.map +1 -1
- package/lib/start/helpers/executeCypress.js +32 -73
- package/lib/start/helpers/executeCypress.js.map +1 -1
- package/lib/start/helpers/extractArgValue.js +7 -7
- package/lib/start/helpers/extractArgValue.js.map +1 -1
- package/lib/start/helpers/findProfilesByNames.js +7 -7
- package/lib/start/helpers/findProfilesByNames.js.map +1 -1
- package/lib/start/helpers/generateHtmlReport.js +19 -19
- package/lib/start/helpers/generateHtmlReport.js.map +1 -1
- package/lib/start/helpers/generateReportHomepage.js +49 -68
- package/lib/start/helpers/generateReportHomepage.js.map +1 -1
- package/lib/start/helpers/generateReporterConfig.js +4 -4
- package/lib/start/helpers/generateReporterConfig.js.map +1 -1
- package/lib/start/helpers/getDateLabeledDir.js +17 -17
- package/lib/start/helpers/getDateLabeledDir.js.map +1 -1
- package/lib/start/helpers/getRootPath.js +3 -3
- package/lib/start/helpers/getRootPath.js.map +1 -1
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js +29 -29
- package/lib/start/helpers/mergeAllReportsAndGenerateHtml.js.map +1 -1
- package/lib/start/helpers/mergeReports.js +22 -22
- package/lib/start/helpers/mergeReports.js.map +1 -1
- package/lib/start/helpers/parseCommaSeparated.js +3 -3
- package/lib/start/helpers/parseCommaSeparated.js.map +1 -1
- package/lib/start/helpers/print.js +19 -19
- package/lib/start/helpers/print.js.map +1 -1
- package/lib/start/helpers/prompt.js +5 -5
- package/lib/start/helpers/prompt.js.map +1 -1
- package/lib/start/helpers/runCypressHeadless.js +41 -52
- package/lib/start/helpers/runCypressHeadless.js.map +1 -1
- package/lib/start/helpers/runCypressVisible.js +13 -24
- package/lib/start/helpers/runCypressVisible.js.map +1 -1
- package/lib/start/helpers/showChooser.js +27 -38
- package/lib/start/helpers/showChooser.js.map +1 -1
- package/lib/start/helpers/validateBrowsers.js +8 -8
- package/lib/start/helpers/validateBrowsers.js.map +1 -1
- package/lib/start/index.js +58 -60
- package/lib/start/index.js.map +1 -1
- package/package.json +6 -4
- package/setup/genE2ELaunchFile.ts +1 -1
- package/setup/genTsConfigFile.ts +55 -0
- package/setup/index.ts +2 -0
- package/src/commands/getCredentialValue.ts +1 -3
- package/src/commands/getProfileValue.ts +2 -1
- package/src/genConfiguration/index.ts +3 -1
- package/tsconfig.json +4 -3
|
@@ -0,0 +1,961 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Ky Functions</title>
|
|
7
|
+
<style>
|
|
8
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
9
|
+
body {
|
|
10
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
11
|
+
background: #f5f6fa;
|
|
12
|
+
color: #222;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 2rem;
|
|
15
|
+
}
|
|
16
|
+
h1 { font-size: 2rem; margin-bottom: 0.25rem; }
|
|
17
|
+
.subtitle { color: #666; margin-bottom: 1.5rem; }
|
|
18
|
+
.toc {
|
|
19
|
+
background: #fff;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
padding: 1.25rem 1.5rem;
|
|
22
|
+
box-shadow: 0 1px 4px rgba(0,0,0,0.10);
|
|
23
|
+
margin-bottom: 2rem;
|
|
24
|
+
}
|
|
25
|
+
.toc h2 { margin: 0 0 0.75rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: #555; }
|
|
26
|
+
.toc ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
|
|
27
|
+
.toc a { text-decoration: none; color: #4f7ef8; font-size: 0.9rem; }
|
|
28
|
+
.toc a:hover { text-decoration: underline; }
|
|
29
|
+
.toc code { background: none; font-size: 0.88rem; }
|
|
30
|
+
.grid {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
|
|
33
|
+
gap: 1.25rem;
|
|
34
|
+
}
|
|
35
|
+
.card {
|
|
36
|
+
background: #fff;
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
padding: 1.25rem 1.5rem;
|
|
39
|
+
box-shadow: 0 1px 4px rgba(0,0,0,0.10);
|
|
40
|
+
border-left: 4px solid #4f7ef8;
|
|
41
|
+
}
|
|
42
|
+
.card h2 {
|
|
43
|
+
margin: 0 0 0.5rem;
|
|
44
|
+
font-size: 1.1rem;
|
|
45
|
+
color: #1a1a2e;
|
|
46
|
+
}
|
|
47
|
+
.card h2 code {
|
|
48
|
+
background: none;
|
|
49
|
+
font-size: 1.05rem;
|
|
50
|
+
}
|
|
51
|
+
.description { margin-bottom: 0.75rem; line-height: 1.6; }
|
|
52
|
+
.description p { margin: 0 0 0.4rem; }
|
|
53
|
+
.returns { font-size: 0.875rem; color: #444; margin: 0.4rem 0; }
|
|
54
|
+
.label { font-weight: 600; }
|
|
55
|
+
.params {
|
|
56
|
+
width: 100%;
|
|
57
|
+
border-collapse: collapse;
|
|
58
|
+
font-size: 0.85rem;
|
|
59
|
+
margin: 0.5rem 0;
|
|
60
|
+
}
|
|
61
|
+
.params th {
|
|
62
|
+
text-align: left;
|
|
63
|
+
background: #f0f3ff;
|
|
64
|
+
padding: 0.35rem 0.6rem;
|
|
65
|
+
border-bottom: 2px solid #dde3f7;
|
|
66
|
+
}
|
|
67
|
+
.params td {
|
|
68
|
+
padding: 0.3rem 0.6rem;
|
|
69
|
+
border-bottom: 1px solid #eee;
|
|
70
|
+
vertical-align: top;
|
|
71
|
+
}
|
|
72
|
+
.params td code {
|
|
73
|
+
background: #f0f3ff;
|
|
74
|
+
padding: 0.1rem 0.3rem;
|
|
75
|
+
border-radius: 3px;
|
|
76
|
+
font-size: 0.82rem;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
79
|
+
</head>
|
|
80
|
+
<body>
|
|
81
|
+
<h1>Ky Functions</h1>
|
|
82
|
+
<p class="subtitle">Ky functions that are available in all Ky projects, in addition to the built-in cypress functions</p>
|
|
83
|
+
<nav class="toc" aria-label="Table of contents">
|
|
84
|
+
<h2>Commands</h2>
|
|
85
|
+
<ul>
|
|
86
|
+
<li><a href="#fn-assertDoesNotHaveClass"><code>ky.assertDoesNotHaveClass()</code></a></li>
|
|
87
|
+
<li><a href="#fn-assertHasClass"><code>ky.assertHasClass()</code></a></li>
|
|
88
|
+
<li><a href="#fn-assertNumElements"><code>ky.assertNumElements()</code></a></li>
|
|
89
|
+
<li><a href="#fn-checkIfElementExists"><code>ky.checkIfElementExists()</code></a></li>
|
|
90
|
+
<li><a href="#fn-extractDataFromClass"><code>ky.extractDataFromClass()</code></a></li>
|
|
91
|
+
<li><a href="#fn-extractDataFromClassByContents"><code>ky.extractDataFromClassByContents()</code></a></li>
|
|
92
|
+
<li><a href="#fn-genTextOfLength"><code>ky.genTextOfLength()</code></a></li>
|
|
93
|
+
<li><a href="#fn-getAttribute"><code>ky.getAttribute()</code></a></li>
|
|
94
|
+
<li><a href="#fn-getClassName"><code>ky.getClassName()</code></a></li>
|
|
95
|
+
<li><a href="#fn-getCredentialValue"><code>ky.getCredentialValue()</code></a></li>
|
|
96
|
+
<li><a href="#fn-getCredentialValues"><code>ky.getCredentialValues()</code></a></li>
|
|
97
|
+
<li><a href="#fn-getCurrentDateInfo"><code>ky.getCurrentDateInfo()</code></a></li>
|
|
98
|
+
<li><a href="#fn-getId"><code>ky.getId()</code></a></li>
|
|
99
|
+
<li><a href="#fn-getJSON"><code>ky.getJSON()</code></a></li>
|
|
100
|
+
<li><a href="#fn-getNumElements"><code>ky.getNumElements()</code></a></li>
|
|
101
|
+
<li><a href="#fn-getProfileValue"><code>ky.getProfileValue()</code></a></li>
|
|
102
|
+
<li><a href="#fn-getSpecialChars"><code>ky.getSpecialChars()</code></a></li>
|
|
103
|
+
<li><a href="#fn-getTitle"><code>ky.getTitle()</code></a></li>
|
|
104
|
+
<li><a href="#fn-handleHarvardKey"><code>ky.handleHarvardKey()</code></a></li>
|
|
105
|
+
<li><a href="#fn-launchAs"><code>ky.launchAs()</code></a></li>
|
|
106
|
+
<li><a href="#fn-listSelectLabels"><code>ky.listSelectLabels()</code></a></li>
|
|
107
|
+
<li><a href="#fn-listSelectValues"><code>ky.listSelectValues()</code></a></li>
|
|
108
|
+
<li><a href="#fn-logIntoPorta"><code>ky.logIntoPorta()</code></a></li>
|
|
109
|
+
<li><a href="#fn-navigateToHref"><code>ky.navigateToHref()</code></a></li>
|
|
110
|
+
<li><a href="#fn-padWithZeros"><code>ky.padWithZeros()</code></a></li>
|
|
111
|
+
<li><a href="#fn-runScript"><code>ky.runScript()</code></a></li>
|
|
112
|
+
<li><a href="#fn-tap"><code>ky.tap()</code></a></li>
|
|
113
|
+
<li><a href="#fn-tapInIFrame"><code>ky.tapInIFrame()</code></a></li>
|
|
114
|
+
<li><a href="#fn-typeInto"><code>ky.typeInto()</code></a></li>
|
|
115
|
+
<li><a href="#fn-uniquify"><code>ky.uniquify()</code></a></li>
|
|
116
|
+
<li><a href="#fn-visitCanvasEndpoint"><code>ky.visitCanvasEndpoint()</code></a></li>
|
|
117
|
+
<li><a href="#fn-waitForAtLeastOneElementPresent"><code>ky.waitForAtLeastOneElementPresent()</code></a></li>
|
|
118
|
+
<li><a href="#fn-waitForElementVisible"><code>ky.waitForElementVisible()</code></a></li>
|
|
119
|
+
</ul>
|
|
120
|
+
</nav>
|
|
121
|
+
<div class="grid">
|
|
122
|
+
|
|
123
|
+
<div class="card" id="fn-assertDoesNotHaveClass">
|
|
124
|
+
<h2><code>ky.assertDoesNotHaveClass()</code></h2>
|
|
125
|
+
<div class="description"><p>Assert that an element does not have a specific className</p>
|
|
126
|
+
</div>
|
|
127
|
+
<table class="params">
|
|
128
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
129
|
+
<tbody>
|
|
130
|
+
|
|
131
|
+
<tr>
|
|
132
|
+
<td><code>opts</code></td>
|
|
133
|
+
<td>No</td>
|
|
134
|
+
<td>object containing all arguments</td>
|
|
135
|
+
</tr>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<tr>
|
|
139
|
+
<td><code>opts.item</code></td>
|
|
140
|
+
<td>No</td>
|
|
141
|
+
<td>the css selector for finding the element</td>
|
|
142
|
+
</tr>
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<tr>
|
|
146
|
+
<td><code>opts.className</code></td>
|
|
147
|
+
<td>No</td>
|
|
148
|
+
<td>the className to check for</td>
|
|
149
|
+
</tr>
|
|
150
|
+
|
|
151
|
+
</tbody>
|
|
152
|
+
</table>
|
|
153
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the element that was checked</p>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<div class="card" id="fn-assertHasClass">
|
|
157
|
+
<h2><code>ky.assertHasClass()</code></h2>
|
|
158
|
+
<div class="description"><p>Assert that an element has a specific className</p>
|
|
159
|
+
</div>
|
|
160
|
+
<table class="params">
|
|
161
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
162
|
+
<tbody>
|
|
163
|
+
|
|
164
|
+
<tr>
|
|
165
|
+
<td><code>opts</code></td>
|
|
166
|
+
<td>No</td>
|
|
167
|
+
<td>object containing all arguments</td>
|
|
168
|
+
</tr>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<tr>
|
|
172
|
+
<td><code>opts.item</code></td>
|
|
173
|
+
<td>No</td>
|
|
174
|
+
<td>the css selector for finding the element</td>
|
|
175
|
+
</tr>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<tr>
|
|
179
|
+
<td><code>opts.className</code></td>
|
|
180
|
+
<td>No</td>
|
|
181
|
+
<td>the className to check for</td>
|
|
182
|
+
</tr>
|
|
183
|
+
|
|
184
|
+
</tbody>
|
|
185
|
+
</table>
|
|
186
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the element that was checked</p>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div class="card" id="fn-assertNumElements">
|
|
190
|
+
<h2><code>ky.assertNumElements()</code></h2>
|
|
191
|
+
<div class="description"><p>Assert a certain number of elements</p>
|
|
192
|
+
</div>
|
|
193
|
+
<table class="params">
|
|
194
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
195
|
+
<tbody>
|
|
196
|
+
|
|
197
|
+
<tr>
|
|
198
|
+
<td><code>opts</code></td>
|
|
199
|
+
<td>No</td>
|
|
200
|
+
<td>object containing all arguments</td>
|
|
201
|
+
</tr>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
<tr>
|
|
205
|
+
<td><code>opts.item</code></td>
|
|
206
|
+
<td>No</td>
|
|
207
|
+
<td>a CSS selector corresponding to the item</td>
|
|
208
|
+
</tr>
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
<tr>
|
|
212
|
+
<td><code>opts.num</code></td>
|
|
213
|
+
<td>No</td>
|
|
214
|
+
<td>the precise number of elements expected</td>
|
|
215
|
+
</tr>
|
|
216
|
+
|
|
217
|
+
</tbody>
|
|
218
|
+
</table>
|
|
219
|
+
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<div class="card" id="fn-checkIfElementExists">
|
|
223
|
+
<h2><code>ky.checkIfElementExists()</code></h2>
|
|
224
|
+
<div class="description"><p>Check if an element exists on the page</p>
|
|
225
|
+
</div>
|
|
226
|
+
<table class="params">
|
|
227
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
228
|
+
<tbody>
|
|
229
|
+
|
|
230
|
+
<tr>
|
|
231
|
+
<td><code>selector</code></td>
|
|
232
|
+
<td>No</td>
|
|
233
|
+
<td>- The selector for the element to check</td>
|
|
234
|
+
</tr>
|
|
235
|
+
|
|
236
|
+
</tbody>
|
|
237
|
+
</table>
|
|
238
|
+
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div class="card" id="fn-extractDataFromClass">
|
|
242
|
+
<h2><code>ky.extractDataFromClass()</code></h2>
|
|
243
|
+
<div class="description"><p>Obtain data from a class attribute that starts with a specific prefix
|
|
244
|
+
and return it</p>
|
|
245
|
+
</div>
|
|
246
|
+
<table class="params">
|
|
247
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
248
|
+
<tbody>
|
|
249
|
+
|
|
250
|
+
<tr>
|
|
251
|
+
<td><code>opts</code></td>
|
|
252
|
+
<td>No</td>
|
|
253
|
+
<td>the options object</td>
|
|
254
|
+
</tr>
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<tr>
|
|
258
|
+
<td><code>opts.selector</code></td>
|
|
259
|
+
<td>No</td>
|
|
260
|
+
<td>the css selector for finding the element</td>
|
|
261
|
+
</tr>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
<tr>
|
|
265
|
+
<td><code>opts.classPrefix</code></td>
|
|
266
|
+
<td>No</td>
|
|
267
|
+
<td>the prefix to look for in the class attribute</td>
|
|
268
|
+
</tr>
|
|
269
|
+
|
|
270
|
+
</tbody>
|
|
271
|
+
</table>
|
|
272
|
+
<p class="returns"><span class="label">Returns:</span> the extracted data</p>
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
<div class="card" id="fn-extractDataFromClassByContents">
|
|
276
|
+
<h2><code>ky.extractDataFromClassByContents()</code></h2>
|
|
277
|
+
<div class="description"><p>Obtain data from a class attribute that starts with a specific prefix
|
|
278
|
+
and with specific contents, and return it</p>
|
|
279
|
+
</div>
|
|
280
|
+
<table class="params">
|
|
281
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
282
|
+
<tbody>
|
|
283
|
+
|
|
284
|
+
<tr>
|
|
285
|
+
<td><code>opts</code></td>
|
|
286
|
+
<td>No</td>
|
|
287
|
+
<td>the options object</td>
|
|
288
|
+
</tr>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
<tr>
|
|
292
|
+
<td><code>opts.contents</code></td>
|
|
293
|
+
<td>No</td>
|
|
294
|
+
<td>the contents of the element to find</td>
|
|
295
|
+
</tr>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
<tr>
|
|
299
|
+
<td><code>opts.selector</code></td>
|
|
300
|
+
<td>No</td>
|
|
301
|
+
<td>the css selector for finding the element</td>
|
|
302
|
+
</tr>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<tr>
|
|
306
|
+
<td><code>opts.classPrefix</code></td>
|
|
307
|
+
<td>No</td>
|
|
308
|
+
<td>the prefix to look for in the class attribute</td>
|
|
309
|
+
</tr>
|
|
310
|
+
|
|
311
|
+
</tbody>
|
|
312
|
+
</table>
|
|
313
|
+
<p class="returns"><span class="label">Returns:</span> the extracted data</p>
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
<div class="card" id="fn-genTextOfLength">
|
|
317
|
+
<h2><code>ky.genTextOfLength()</code></h2>
|
|
318
|
+
<div class="description"><p>Generate a string of specified length for Cypress tests</p>
|
|
319
|
+
</div>
|
|
320
|
+
<table class="params">
|
|
321
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
322
|
+
<tbody>
|
|
323
|
+
|
|
324
|
+
<tr>
|
|
325
|
+
<td><code>opts</code></td>
|
|
326
|
+
<td>No</td>
|
|
327
|
+
<td>options object</td>
|
|
328
|
+
</tr>
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
<tr>
|
|
332
|
+
<td><code>opts.length</code></td>
|
|
333
|
+
<td>No</td>
|
|
334
|
+
<td>the desired length of the string</td>
|
|
335
|
+
</tr>
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
<tr>
|
|
339
|
+
<td><code>opts.text</code></td>
|
|
340
|
+
<td>No</td>
|
|
341
|
+
<td>optional text to repeat to form the string; defaults to '123456789x' if not provided</td>
|
|
342
|
+
</tr>
|
|
343
|
+
|
|
344
|
+
</tbody>
|
|
345
|
+
</table>
|
|
346
|
+
<p class="returns"><span class="label">Returns:</span> a string of the specified length, if the length is not a multiple of the text length, it is truncated</p>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<div class="card" id="fn-getAttribute">
|
|
350
|
+
<h2><code>ky.getAttribute()</code></h2>
|
|
351
|
+
<div class="description"><p>Get the attribute of an element</p>
|
|
352
|
+
</div>
|
|
353
|
+
<table class="params">
|
|
354
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
355
|
+
<tbody>
|
|
356
|
+
|
|
357
|
+
<tr>
|
|
358
|
+
<td><code>opts</code></td>
|
|
359
|
+
<td>No</td>
|
|
360
|
+
<td>options object</td>
|
|
361
|
+
</tr>
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
<tr>
|
|
365
|
+
<td><code>opts.selector</code></td>
|
|
366
|
+
<td>No</td>
|
|
367
|
+
<td>the CSS selector of the element</td>
|
|
368
|
+
</tr>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
<tr>
|
|
372
|
+
<td><code>opts.attribute</code></td>
|
|
373
|
+
<td>No</td>
|
|
374
|
+
<td>the attribute to retrieve</td>
|
|
375
|
+
</tr>
|
|
376
|
+
|
|
377
|
+
</tbody>
|
|
378
|
+
</table>
|
|
379
|
+
<p class="returns"><span class="label">Returns:</span> the attribute of the element</p>
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
<div class="card" id="fn-getClassName">
|
|
383
|
+
<h2><code>ky.getClassName()</code></h2>
|
|
384
|
+
<div class="description"><p>Get the class attribute of an element</p>
|
|
385
|
+
</div>
|
|
386
|
+
<table class="params">
|
|
387
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
388
|
+
<tbody>
|
|
389
|
+
|
|
390
|
+
<tr>
|
|
391
|
+
<td><code>selector</code></td>
|
|
392
|
+
<td>No</td>
|
|
393
|
+
<td>the CSS selector of the element</td>
|
|
394
|
+
</tr>
|
|
395
|
+
|
|
396
|
+
</tbody>
|
|
397
|
+
</table>
|
|
398
|
+
<p class="returns"><span class="label">Returns:</span> the class of the element, if multiple classes exist, they are space-separated</p>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
<div class="card" id="fn-getCredentialValue">
|
|
402
|
+
<h2><code>ky.getCredentialValue()</code></h2>
|
|
403
|
+
<div class="description"><p>Get a credential from GlobalCredentials</p>
|
|
404
|
+
</div>
|
|
405
|
+
<table class="params">
|
|
406
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
407
|
+
<tbody>
|
|
408
|
+
|
|
409
|
+
<tr>
|
|
410
|
+
<td><code>key</code></td>
|
|
411
|
+
<td>No</td>
|
|
412
|
+
<td>the key of the environment variable to retrieve</td>
|
|
413
|
+
</tr>
|
|
414
|
+
|
|
415
|
+
</tbody>
|
|
416
|
+
</table>
|
|
417
|
+
<p class="returns"><span class="label">Returns:</span> The value of the specified environment variable</p>
|
|
418
|
+
</div>
|
|
419
|
+
|
|
420
|
+
<div class="card" id="fn-getCredentialValues">
|
|
421
|
+
<h2><code>ky.getCredentialValues()</code></h2>
|
|
422
|
+
<div class="description"><p>Alias for cy.env for retrieving multiple environment variables at once
|
|
423
|
+
Obtains multiple credential values from the Cypress env depending on
|
|
424
|
+
the provided keys.</p>
|
|
425
|
+
</div>
|
|
426
|
+
<table class="params">
|
|
427
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
428
|
+
<tbody>
|
|
429
|
+
|
|
430
|
+
<tr>
|
|
431
|
+
<td><code>keys</code></td>
|
|
432
|
+
<td>No</td>
|
|
433
|
+
<td>the keys of the environment variables to retrieve</td>
|
|
434
|
+
</tr>
|
|
435
|
+
|
|
436
|
+
</tbody>
|
|
437
|
+
</table>
|
|
438
|
+
<p class="returns"><span class="label">Returns:</span> Object where keys are the provided keys and the values are</p>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
441
|
+
<div class="card" id="fn-getCurrentDateInfo">
|
|
442
|
+
<h2><code>ky.getCurrentDateInfo()</code></h2>
|
|
443
|
+
<div class="description"><p>Get the current day</p>
|
|
444
|
+
</div>
|
|
445
|
+
|
|
446
|
+
<p class="returns"><span class="label">Returns:</span> the current month as a number (1-31)</p>
|
|
447
|
+
</div>
|
|
448
|
+
|
|
449
|
+
<div class="card" id="fn-getId">
|
|
450
|
+
<h2><code>ky.getId()</code></h2>
|
|
451
|
+
<div class="description"><p>Get the id of an element</p>
|
|
452
|
+
</div>
|
|
453
|
+
<table class="params">
|
|
454
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
455
|
+
<tbody>
|
|
456
|
+
|
|
457
|
+
<tr>
|
|
458
|
+
<td><code>selector</code></td>
|
|
459
|
+
<td>No</td>
|
|
460
|
+
<td>the CSS selector of the element</td>
|
|
461
|
+
</tr>
|
|
462
|
+
|
|
463
|
+
</tbody>
|
|
464
|
+
</table>
|
|
465
|
+
<p class="returns"><span class="label">Returns:</span> the id of the element</p>
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
<div class="card" id="fn-getJSON">
|
|
469
|
+
<h2><code>ky.getJSON()</code></h2>
|
|
470
|
+
<div class="description"><p>Obtain JSON data from a request and return it.</p>
|
|
471
|
+
</div>
|
|
472
|
+
<table class="params">
|
|
473
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
474
|
+
<tbody>
|
|
475
|
+
|
|
476
|
+
<tr>
|
|
477
|
+
<td><code>url</code></td>
|
|
478
|
+
<td>No</td>
|
|
479
|
+
<td>the URL to fetch the JSON data from</td>
|
|
480
|
+
</tr>
|
|
481
|
+
|
|
482
|
+
</tbody>
|
|
483
|
+
</table>
|
|
484
|
+
<p class="returns"><span class="label">Returns:</span> the JSON data</p>
|
|
485
|
+
</div>
|
|
486
|
+
|
|
487
|
+
<div class="card" id="fn-getNumElements">
|
|
488
|
+
<h2><code>ky.getNumElements()</code></h2>
|
|
489
|
+
<div class="description"><p>Get number of elements</p>
|
|
490
|
+
</div>
|
|
491
|
+
<table class="params">
|
|
492
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
493
|
+
<tbody>
|
|
494
|
+
|
|
495
|
+
<tr>
|
|
496
|
+
<td><code>selector</code></td>
|
|
497
|
+
<td>No</td>
|
|
498
|
+
<td>a CSS selector corresponding to the item to count</td>
|
|
499
|
+
</tr>
|
|
500
|
+
|
|
501
|
+
</tbody>
|
|
502
|
+
</table>
|
|
503
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the number of elements matching the selector</p>
|
|
504
|
+
</div>
|
|
505
|
+
|
|
506
|
+
<div class="card" id="fn-getProfileValue">
|
|
507
|
+
<h2><code>ky.getProfileValue()</code></h2>
|
|
508
|
+
<div class="description"><p>Get a (non-credential) value from the current profile,
|
|
509
|
+
GlobalValues, or GlobalResources</p>
|
|
510
|
+
</div>
|
|
511
|
+
<table class="params">
|
|
512
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
513
|
+
<tbody>
|
|
514
|
+
|
|
515
|
+
<tr>
|
|
516
|
+
<td><code>key</code></td>
|
|
517
|
+
<td>No</td>
|
|
518
|
+
<td>the key of the environment variable to retrieve</td>
|
|
519
|
+
</tr>
|
|
520
|
+
|
|
521
|
+
</tbody>
|
|
522
|
+
</table>
|
|
523
|
+
|
|
524
|
+
</div>
|
|
525
|
+
|
|
526
|
+
<div class="card" id="fn-getSpecialChars">
|
|
527
|
+
<h2><code>ky.getSpecialChars()</code></h2>
|
|
528
|
+
<div class="description"><p>Generate all printable special characters for Cypress tests</p>
|
|
529
|
+
</div>
|
|
530
|
+
|
|
531
|
+
<p class="returns"><span class="label">Returns:</span> a string containing all special characters</p>
|
|
532
|
+
</div>
|
|
533
|
+
|
|
534
|
+
<div class="card" id="fn-getTitle">
|
|
535
|
+
<h2><code>ky.getTitle()</code></h2>
|
|
536
|
+
<div class="description"><p>Get the current title of the page</p>
|
|
537
|
+
</div>
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
</div>
|
|
541
|
+
|
|
542
|
+
<div class="card" id="fn-handleHarvardKey">
|
|
543
|
+
<h2><code>ky.handleHarvardKey()</code></h2>
|
|
544
|
+
<div class="description"><p>Handle a HarvardKey login page for a user via UI (form filling with cy.origin(), not API calls)</p>
|
|
545
|
+
</div>
|
|
546
|
+
<table class="params">
|
|
547
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
548
|
+
<tbody>
|
|
549
|
+
|
|
550
|
+
<tr>
|
|
551
|
+
<td><code>name</code></td>
|
|
552
|
+
<td>No</td>
|
|
553
|
+
<td>the name of the user environment variable</td>
|
|
554
|
+
</tr>
|
|
555
|
+
|
|
556
|
+
</tbody>
|
|
557
|
+
</table>
|
|
558
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable (void) - performs authentication flow, no return value</p>
|
|
559
|
+
</div>
|
|
560
|
+
|
|
561
|
+
<div class="card" id="fn-launchAs">
|
|
562
|
+
<h2><code>ky.launchAs()</code></h2>
|
|
563
|
+
<div class="description"><p>Log into Canvas and launch an LTI app as a specific user from environment variables.
|
|
564
|
+
The user should be defined as an environment variable with the following properties:</p>
|
|
565
|
+
<ul>
|
|
566
|
+
<li>accessToken: Canvas access token for the user (required for production mode)</li>
|
|
567
|
+
<li>username: the HarvardKey username of the user</li>
|
|
568
|
+
<li>password: the HarvardKey password of the user</li>
|
|
569
|
+
</ul>
|
|
570
|
+
</div>
|
|
571
|
+
<table class="params">
|
|
572
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
573
|
+
<tbody>
|
|
574
|
+
|
|
575
|
+
<tr>
|
|
576
|
+
<td><code>name</code></td>
|
|
577
|
+
<td>No</td>
|
|
578
|
+
<td>the name of the user environment variable</td>
|
|
579
|
+
</tr>
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
<tr>
|
|
583
|
+
<td><code>opts</code></td>
|
|
584
|
+
<td>No</td>
|
|
585
|
+
<td>object containing all arguments</td>
|
|
586
|
+
</tr>
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
<tr>
|
|
590
|
+
<td><code>opts.courseId</code></td>
|
|
591
|
+
<td>Yes</td>
|
|
592
|
+
<td>the Canvas ID of the course to launch from</td>
|
|
593
|
+
</tr>
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
<tr>
|
|
597
|
+
<td><code>opts.appName</code></td>
|
|
598
|
+
<td>Yes</td>
|
|
599
|
+
<td>the name of the app as it appears in the course's left-hand nav</td>
|
|
600
|
+
</tr>
|
|
601
|
+
|
|
602
|
+
</tbody>
|
|
603
|
+
</table>
|
|
604
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable (void) - launches the LTI app, no return value</p>
|
|
605
|
+
</div>
|
|
606
|
+
|
|
607
|
+
<div class="card" id="fn-listSelectLabels">
|
|
608
|
+
<h2><code>ky.listSelectLabels()</code></h2>
|
|
609
|
+
<div class="description"><p>Get the labels of all the options within a select element</p>
|
|
610
|
+
</div>
|
|
611
|
+
<table class="params">
|
|
612
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
613
|
+
<tbody>
|
|
614
|
+
|
|
615
|
+
<tr>
|
|
616
|
+
<td><code>selector</code></td>
|
|
617
|
+
<td>No</td>
|
|
618
|
+
<td>the CSS selector of the select element</td>
|
|
619
|
+
</tr>
|
|
620
|
+
|
|
621
|
+
</tbody>
|
|
622
|
+
</table>
|
|
623
|
+
<p class="returns"><span class="label">Returns:</span> an array of strings representing the labels of the options</p>
|
|
624
|
+
</div>
|
|
625
|
+
|
|
626
|
+
<div class="card" id="fn-listSelectValues">
|
|
627
|
+
<h2><code>ky.listSelectValues()</code></h2>
|
|
628
|
+
<div class="description"><p>Get the values of all the options within a select element</p>
|
|
629
|
+
</div>
|
|
630
|
+
<table class="params">
|
|
631
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
632
|
+
<tbody>
|
|
633
|
+
|
|
634
|
+
<tr>
|
|
635
|
+
<td><code>selector</code></td>
|
|
636
|
+
<td>No</td>
|
|
637
|
+
<td>the CSS selector of the select element</td>
|
|
638
|
+
</tr>
|
|
639
|
+
|
|
640
|
+
</tbody>
|
|
641
|
+
</table>
|
|
642
|
+
<p class="returns"><span class="label">Returns:</span> an array of strings representing the values of the options</p>
|
|
643
|
+
</div>
|
|
644
|
+
|
|
645
|
+
<div class="card" id="fn-logIntoPorta">
|
|
646
|
+
<h2><code>ky.logIntoPorta()</code></h2>
|
|
647
|
+
<div class="description"><p>Log into Porta via HarvardKey authentication using API requests (no UI interaction).</p>
|
|
648
|
+
<p>Flow:</p>
|
|
649
|
+
<ol>
|
|
650
|
+
<li>GET Cirrus Identity discovery page → extract HarvardKey IdP button href</li>
|
|
651
|
+
<li>GET IdP login page → extract form action and hidden fields</li>
|
|
652
|
+
<li>POST credentials to the login form</li>
|
|
653
|
+
<li>POST SAML form to ACS</li>
|
|
654
|
+
</ol>
|
|
655
|
+
</div>
|
|
656
|
+
<table class="params">
|
|
657
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
658
|
+
<tbody>
|
|
659
|
+
|
|
660
|
+
<tr>
|
|
661
|
+
<td><code>name</code></td>
|
|
662
|
+
<td>No</td>
|
|
663
|
+
<td>the name of the user environment variable</td>
|
|
664
|
+
</tr>
|
|
665
|
+
|
|
666
|
+
</tbody>
|
|
667
|
+
</table>
|
|
668
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable (void) - performs authentication flow, no return value</p>
|
|
669
|
+
</div>
|
|
670
|
+
|
|
671
|
+
<div class="card" id="fn-navigateToHref">
|
|
672
|
+
<h2><code>ky.navigateToHref()</code></h2>
|
|
673
|
+
<div class="description"><p>Navigate to href attribute of Harvard identity provider button</p>
|
|
674
|
+
</div>
|
|
675
|
+
<table class="params">
|
|
676
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
677
|
+
<tbody>
|
|
678
|
+
|
|
679
|
+
<tr>
|
|
680
|
+
<td><code>item</code></td>
|
|
681
|
+
<td>No</td>
|
|
682
|
+
<td>the CSS selector of interest</td>
|
|
683
|
+
</tr>
|
|
684
|
+
|
|
685
|
+
</tbody>
|
|
686
|
+
</table>
|
|
687
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the full URL string (hostname + href attribute value)</p>
|
|
688
|
+
</div>
|
|
689
|
+
|
|
690
|
+
<div class="card" id="fn-padWithZeros">
|
|
691
|
+
<h2><code>ky.padWithZeros()</code></h2>
|
|
692
|
+
<div class="description"><p>Pads a number with leading zeros to a user-defined length.</p>
|
|
693
|
+
</div>
|
|
694
|
+
<table class="params">
|
|
695
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
696
|
+
<tbody>
|
|
697
|
+
|
|
698
|
+
<tr>
|
|
699
|
+
<td><code>opts</code></td>
|
|
700
|
+
<td>No</td>
|
|
701
|
+
<td>options object</td>
|
|
702
|
+
</tr>
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
<tr>
|
|
706
|
+
<td><code>opts.length</code></td>
|
|
707
|
+
<td>No</td>
|
|
708
|
+
<td>the desired total length of the output string, must be larger than the length of the number</td>
|
|
709
|
+
</tr>
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
<tr>
|
|
713
|
+
<td><code>opts.number</code></td>
|
|
714
|
+
<td>No</td>
|
|
715
|
+
<td>the number to be padded with leading zeros</td>
|
|
716
|
+
</tr>
|
|
717
|
+
|
|
718
|
+
</tbody>
|
|
719
|
+
</table>
|
|
720
|
+
<p class="returns"><span class="label">Returns:</span> padded string with leading zeros</p>
|
|
721
|
+
</div>
|
|
722
|
+
|
|
723
|
+
<div class="card" id="fn-runScript">
|
|
724
|
+
<h2><code>ky.runScript()</code></h2>
|
|
725
|
+
<div class="description"><p>Run a script on the page</p>
|
|
726
|
+
</div>
|
|
727
|
+
<table class="params">
|
|
728
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
729
|
+
<tbody>
|
|
730
|
+
|
|
731
|
+
<tr>
|
|
732
|
+
<td><code>script</code></td>
|
|
733
|
+
<td>No</td>
|
|
734
|
+
<td>the script to run</td>
|
|
735
|
+
</tr>
|
|
736
|
+
|
|
737
|
+
</tbody>
|
|
738
|
+
</table>
|
|
739
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the return value from executing the script</p>
|
|
740
|
+
</div>
|
|
741
|
+
|
|
742
|
+
<div class="card" id="fn-tap">
|
|
743
|
+
<h2><code>ky.tap()</code></h2>
|
|
744
|
+
<div class="description"><p>Click on an element.</p>
|
|
745
|
+
</div>
|
|
746
|
+
<table class="params">
|
|
747
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
748
|
+
<tbody>
|
|
749
|
+
|
|
750
|
+
<tr>
|
|
751
|
+
<td><code>item</code></td>
|
|
752
|
+
<td>No</td>
|
|
753
|
+
<td>the CSS selector of interest</td>
|
|
754
|
+
</tr>
|
|
755
|
+
|
|
756
|
+
</tbody>
|
|
757
|
+
</table>
|
|
758
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the clicked element</p>
|
|
759
|
+
</div>
|
|
760
|
+
|
|
761
|
+
<div class="card" id="fn-tapInIFrame">
|
|
762
|
+
<h2><code>ky.tapInIFrame()</code></h2>
|
|
763
|
+
<div class="description"><p>Given an iframe, begins controlling it.</p>
|
|
764
|
+
</div>
|
|
765
|
+
<table class="params">
|
|
766
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
767
|
+
<tbody>
|
|
768
|
+
|
|
769
|
+
<tr>
|
|
770
|
+
<td><code>iframeSelector</code></td>
|
|
771
|
+
<td>No</td>
|
|
772
|
+
<td>- The selector for the iframe to control</td>
|
|
773
|
+
</tr>
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
<tr>
|
|
777
|
+
<td><code>selectorToTap</code></td>
|
|
778
|
+
<td>No</td>
|
|
779
|
+
<td>- The selector for the element inside the iframe to tap</td>
|
|
780
|
+
</tr>
|
|
781
|
+
|
|
782
|
+
</tbody>
|
|
783
|
+
</table>
|
|
784
|
+
|
|
785
|
+
</div>
|
|
786
|
+
|
|
787
|
+
<div class="card" id="fn-typeInto">
|
|
788
|
+
<h2><code>ky.typeInto()</code></h2>
|
|
789
|
+
<div class="description"><p>Type text into an element. This function first removes the previous text in the element</p>
|
|
790
|
+
</div>
|
|
791
|
+
<table class="params">
|
|
792
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
793
|
+
<tbody>
|
|
794
|
+
|
|
795
|
+
<tr>
|
|
796
|
+
<td><code>opts</code></td>
|
|
797
|
+
<td>No</td>
|
|
798
|
+
<td>object containing all arguments</td>
|
|
799
|
+
</tr>
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
<tr>
|
|
803
|
+
<td><code>opts.item</code></td>
|
|
804
|
+
<td>No</td>
|
|
805
|
+
<td>the CSS selector of interest</td>
|
|
806
|
+
</tr>
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
<tr>
|
|
810
|
+
<td><code>opts.text</code></td>
|
|
811
|
+
<td>No</td>
|
|
812
|
+
<td>the text to type</td>
|
|
813
|
+
</tr>
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
<tr>
|
|
817
|
+
<td><code>opts.pressEnter</code></td>
|
|
818
|
+
<td>Yes</td>
|
|
819
|
+
<td>if true, after typing into the text field, simulate pressing enter</td>
|
|
820
|
+
</tr>
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
<tr>
|
|
824
|
+
<td><code>opts.append</code></td>
|
|
825
|
+
<td>Yes</td>
|
|
826
|
+
<td>if true, append the text to the end of the existing text in the element instead of replacing it</td>
|
|
827
|
+
</tr>
|
|
828
|
+
|
|
829
|
+
</tbody>
|
|
830
|
+
</table>
|
|
831
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the input element that text was typed into</p>
|
|
832
|
+
</div>
|
|
833
|
+
|
|
834
|
+
<div class="card" id="fn-uniquify">
|
|
835
|
+
<h2><code>ky.uniquify()</code></h2>
|
|
836
|
+
<div class="description"><p>Makes a string unique by appending a timestamp and a counter.</p>
|
|
837
|
+
</div>
|
|
838
|
+
<table class="params">
|
|
839
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
840
|
+
<tbody>
|
|
841
|
+
|
|
842
|
+
<tr>
|
|
843
|
+
<td><code>text</code></td>
|
|
844
|
+
<td>No</td>
|
|
845
|
+
<td>the original string</td>
|
|
846
|
+
</tr>
|
|
847
|
+
|
|
848
|
+
</tbody>
|
|
849
|
+
</table>
|
|
850
|
+
<p class="returns"><span class="label">Returns:</span> the uniquified string</p>
|
|
851
|
+
</div>
|
|
852
|
+
|
|
853
|
+
<div class="card" id="fn-visitCanvasEndpoint">
|
|
854
|
+
<h2><code>ky.visitCanvasEndpoint()</code></h2>
|
|
855
|
+
<div class="description"><p>Send a request to a Canvas API endpoint.</p>
|
|
856
|
+
</div>
|
|
857
|
+
<table class="params">
|
|
858
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
859
|
+
<tbody>
|
|
860
|
+
|
|
861
|
+
<tr>
|
|
862
|
+
<td><code>opts</code></td>
|
|
863
|
+
<td>No</td>
|
|
864
|
+
<td>options object</td>
|
|
865
|
+
</tr>
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
<tr>
|
|
869
|
+
<td><code>opts.method</code></td>
|
|
870
|
+
<td>No</td>
|
|
871
|
+
<td>the HTTP method (e.g., 'GET', 'POST', 'DELETE')</td>
|
|
872
|
+
</tr>
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
<tr>
|
|
876
|
+
<td><code>opts.path</code></td>
|
|
877
|
+
<td>No</td>
|
|
878
|
+
<td>the API endpoint path excluding 'https://canvas.harvard.edu', (e.g., '/api/v1/courses/123')</td>
|
|
879
|
+
</tr>
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
<tr>
|
|
883
|
+
<td><code>opts.accessToken</code></td>
|
|
884
|
+
<td>No</td>
|
|
885
|
+
<td>the access token for authentication</td>
|
|
886
|
+
</tr>
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
<tr>
|
|
890
|
+
<td><code>opts.params</code></td>
|
|
891
|
+
<td>No</td>
|
|
892
|
+
<td>the request params (if any)</td>
|
|
893
|
+
</tr>
|
|
894
|
+
|
|
895
|
+
</tbody>
|
|
896
|
+
</table>
|
|
897
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the Canvas API response body</p>
|
|
898
|
+
</div>
|
|
899
|
+
|
|
900
|
+
<div class="card" id="fn-waitForAtLeastOneElementPresent">
|
|
901
|
+
<h2><code>ky.waitForAtLeastOneElementPresent()</code></h2>
|
|
902
|
+
<div class="description"><p>Wait for any element in a list to be present (check every tenth
|
|
903
|
+
of a second for status)</p>
|
|
904
|
+
</div>
|
|
905
|
+
<table class="params">
|
|
906
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
907
|
+
<tbody>
|
|
908
|
+
|
|
909
|
+
<tr>
|
|
910
|
+
<td><code>opts</code></td>
|
|
911
|
+
<td>No</td>
|
|
912
|
+
<td>object containing all arguments</td>
|
|
913
|
+
</tr>
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
<tr>
|
|
917
|
+
<td><code>opts.items</code></td>
|
|
918
|
+
<td>No</td>
|
|
919
|
+
<td>list of CSS selectors of interest</td>
|
|
920
|
+
</tr>
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
<tr>
|
|
924
|
+
<td><code>opts.timeoutSec</code></td>
|
|
925
|
+
<td>Yes</td>
|
|
926
|
+
<td>the number of seconds to wait before</td>
|
|
927
|
+
</tr>
|
|
928
|
+
|
|
929
|
+
</tbody>
|
|
930
|
+
</table>
|
|
931
|
+
<p class="returns"><span class="label">Returns:</span> the selector of the item that was found first, ties</p>
|
|
932
|
+
</div>
|
|
933
|
+
|
|
934
|
+
<div class="card" id="fn-waitForElementVisible">
|
|
935
|
+
<h2><code>ky.waitForElementVisible()</code></h2>
|
|
936
|
+
<div class="description"><p>Wait for an element to be visible</p>
|
|
937
|
+
</div>
|
|
938
|
+
<table class="params">
|
|
939
|
+
<thead><tr><th>Parameter</th><th>Optional</th><th>Description</th></tr></thead>
|
|
940
|
+
<tbody>
|
|
941
|
+
|
|
942
|
+
<tr>
|
|
943
|
+
<td><code>item</code></td>
|
|
944
|
+
<td>No</td>
|
|
945
|
+
<td>the CSS selector of interest</td>
|
|
946
|
+
</tr>
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
<tr>
|
|
950
|
+
<td><code>timeoutSec</code></td>
|
|
951
|
+
<td>Yes</td>
|
|
952
|
+
<td>=10] the number of seconds to wait before timing out</td>
|
|
953
|
+
</tr>
|
|
954
|
+
|
|
955
|
+
</tbody>
|
|
956
|
+
</table>
|
|
957
|
+
<p class="returns"><span class="label">Returns:</span> Cypress chainable containing the visible element</p>
|
|
958
|
+
</div>
|
|
959
|
+
</div>
|
|
960
|
+
</body>
|
|
961
|
+
</html>
|