Commit 7991855
authored
test: Make tests faster, more robust, more consistent (#692)
* fix(tests): Restore window size after scroll tests
* docs(tests): "Selenium" -> "WebdriverIO"
We aren't using Selenium, so we shouldn't be saying we do.
* chore(tests): Make timeout(0) calls only when PAUSE_TIME is nonzero
With PAUSE_TIME set to zero, on my relatively fast laptop none of
these tests run slow enough to fail due to the default 2s timeous, and
even with PAUSE_TIME set to 50ms the slowest test is 1024ms (of which
700ms is spent in brower.pause calls inside sendKeyAndWait).
We do want to disable timeouts when debugging tests, both because we
might set PAUSE_TIME to a larger value and because we might use the
debugger to pause things entirely, but we don't need to disable
timeouts when running tests just to check their results.
* fix(tests): Set PAUSE_TIME to 0
It's very useful to be able to make tests run more slowly so you
can watch them, but they should run as fast as possible by default.
This cuts total test execution time on a 2021 MacBook Pro M1
approximately in half, from 42s to 22s.
* refactor(tests): Use sendKeyAndWait where appropriate
In most places we were already following browser.keys with a
browser.pause(PAUSE_TIME), so using sendKeysAndWait is more
succinct; in other places we didn't have the pause but it is
not harmful to add a pause (especially now the default PAUSE_TIME
is zero) and could be helpful when watching tests run with a
non-zero PAUSE_TIME.
* fix(tests): Make tabNavigateToWorkspace idempotent
Previously this function would just send a bunch of tabs, which
depended on focus state being as-on-document-load. Some tests
(notably the ones in basic_test.ts) that have only a suiteSetup
and not a (per-test) setup method were only were only passing
because of the combination of:
* Due to issue #632, pressing tab when the workspace is focused
(and there are no further focusable elements on the page)
incorrectly causes focus to move to the first focusable element
on the page instead of (as would normally be the case) to the
browser controls, and
* The fact that the index.html had exactly one additional focusable
div on the page, preceding the injection div.
This meant that calling tabNavigateToWorkspace when the workspace
was already focused would, only by sheer coincidence, result in the
focus remaining on the workspace.
By explicitly focusing a known element, tabNavigateToWorkspace
should work correctly regardless of how many focusable elements
are on the page and which one (if any) was focused before the call.
* chore(tests): Remove unneeded tabNavigateToWorkspace calls
Any time a tabNavigateToWorkspace call is followed by a call to
focusOnBlock the former can be removed with no discernable effect
except to make tests run slightly faster and with less flashing
of the flyout.
* fix(tests): Increase timeout for certain slow tests
* docs(tests): Fix typo
* chore(tests): Add missing timeout(0) calls (when PAUSE_TIME is nonzero)
These two files were inadvertently omitted from commit 14d619c.
* fix(tests): Lint
* fix(tests): Add missing import1 parent e16f5aa commit 7991855
File tree
17 files changed
+203
-241
lines changed- test/webdriverio/test
17 files changed
+203
-241
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
33 | | - | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
37 | | - | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
| |||
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | | - | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
79 | | - | |
80 | | - | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | | - | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | | - | |
70 | 67 | | |
71 | 68 | | |
72 | 69 | | |
| |||
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
80 | | - | |
81 | | - | |
82 | 77 | | |
83 | 78 | | |
84 | 79 | | |
| |||
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
91 | | - | |
92 | | - | |
93 | 86 | | |
94 | 87 | | |
95 | 88 | | |
| |||
99 | 92 | | |
100 | 93 | | |
101 | 94 | | |
102 | | - | |
103 | | - | |
104 | 95 | | |
105 | 96 | | |
106 | 97 | | |
| |||
113 | 104 | | |
114 | 105 | | |
115 | 106 | | |
116 | | - | |
117 | | - | |
118 | 107 | | |
119 | 108 | | |
120 | 109 | | |
| |||
126 | 115 | | |
127 | 116 | | |
128 | 117 | | |
129 | | - | |
130 | | - | |
131 | 118 | | |
132 | 119 | | |
133 | 120 | | |
| |||
139 | 126 | | |
140 | 127 | | |
141 | 128 | | |
142 | | - | |
143 | | - | |
144 | 129 | | |
145 | 130 | | |
146 | 131 | | |
| |||
152 | 137 | | |
153 | 138 | | |
154 | 139 | | |
155 | | - | |
156 | | - | |
157 | 140 | | |
158 | 141 | | |
159 | 142 | | |
| |||
165 | 148 | | |
166 | 149 | | |
167 | 150 | | |
168 | | - | |
169 | | - | |
170 | 151 | | |
171 | 152 | | |
172 | 153 | | |
| |||
178 | 159 | | |
179 | 160 | | |
180 | 161 | | |
181 | | - | |
182 | | - | |
183 | 162 | | |
184 | 163 | | |
185 | 164 | | |
| |||
190 | 169 | | |
191 | 170 | | |
192 | 171 | | |
193 | | - | |
194 | | - | |
195 | 172 | | |
196 | 173 | | |
197 | 174 | | |
| |||
202 | 179 | | |
203 | 180 | | |
204 | 181 | | |
205 | | - | |
206 | | - | |
207 | 182 | | |
208 | 183 | | |
209 | 184 | | |
| |||
214 | 189 | | |
215 | 190 | | |
216 | 191 | | |
217 | | - | |
218 | | - | |
219 | 192 | | |
220 | 193 | | |
221 | 194 | | |
| |||
236 | 209 | | |
237 | 210 | | |
238 | 211 | | |
239 | | - | |
240 | | - | |
241 | 212 | | |
242 | | - | |
243 | | - | |
| 213 | + | |
244 | 214 | | |
245 | 215 | | |
246 | 216 | | |
247 | | - | |
248 | | - | |
| 217 | + | |
249 | 218 | | |
250 | 219 | | |
251 | 220 | | |
252 | 221 | | |
253 | 222 | | |
254 | 223 | | |
255 | | - | |
256 | | - | |
| 224 | + | |
| 225 | + | |
257 | 226 | | |
258 | | - | |
| 227 | + | |
259 | 228 | | |
260 | 229 | | |
261 | 230 | | |
262 | 231 | | |
263 | 232 | | |
264 | | - | |
265 | | - | |
266 | 233 | | |
267 | 234 | | |
268 | 235 | | |
| |||
274 | 241 | | |
275 | 242 | | |
276 | 243 | | |
277 | | - | |
278 | | - | |
279 | 244 | | |
280 | 245 | | |
281 | 246 | | |
| |||
287 | 252 | | |
288 | 253 | | |
289 | 254 | | |
290 | | - | |
291 | | - | |
292 | 255 | | |
293 | 256 | | |
294 | 257 | | |
| |||
301 | 264 | | |
302 | 265 | | |
303 | 266 | | |
304 | | - | |
305 | | - | |
306 | 267 | | |
307 | 268 | | |
308 | 269 | | |
| |||
315 | 276 | | |
316 | 277 | | |
317 | 278 | | |
318 | | - | |
319 | | - | |
320 | 279 | | |
321 | 280 | | |
322 | 281 | | |
| |||
327 | 286 | | |
328 | 287 | | |
329 | 288 | | |
330 | | - | |
331 | | - | |
332 | 289 | | |
333 | 290 | | |
334 | 291 | | |
| |||
339 | 296 | | |
340 | 297 | | |
341 | 298 | | |
342 | | - | |
343 | | - | |
344 | 299 | | |
345 | 300 | | |
346 | 301 | | |
| |||
354 | 309 | | |
355 | 310 | | |
356 | 311 | | |
357 | | - | |
358 | | - | |
| 312 | + | |
359 | 313 | | |
360 | 314 | | |
361 | 315 | | |
| |||
368 | 322 | | |
369 | 323 | | |
370 | 324 | | |
371 | | - | |
372 | | - | |
| 325 | + | |
373 | 326 | | |
374 | 327 | | |
375 | 328 | | |
376 | 329 | | |
377 | | - | |
| 330 | + | |
378 | 331 | | |
379 | 332 | | |
380 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | | - | |
| 21 | + | |
| 22 | + | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments