Commit f01dc58
authored
Harden E2E UiAutomator text-wait helpers against recomposition (#6383)
* Make Wait.kt's text-wait resilient to recomposition.
Rework UiObject2.waitForText into BySelector.waitForText that re-resolves the selector on each poll, absorbing StaleObjectException from mid-poll recomposition. Bypass the findObject() extension (which lies about nullability) by calling device.findObject(this) directly. Accept a mustBeEqual flag so the channel-preview assertion can substring-match and avoid timing out when the rendered preview has trailing whitespace. Update the 4 robot call sites.
* Throw descriptive error from waitToAppear on timeout.
waitToAppear and waitToAppear(withIndex) previously NPE'd via the findObject() extension's non-null declaration when the selector didn't match before timeout. Now they throw IllegalStateException with the selector, timeout, and (for the indexed overload) matched object count.
* Fix stale channel-preview test to match post-#6212 behavior.
Since #6212 (2026-03-05), the channel preview shows "Message deleted" when the last message is soft-deleted instead of falling back to the previous message. Rename the test, update the assertion, and add a dedicated assertDeletedMessageInChannelPreview helper.
* Use waitForText for remaining text asserts and throttle its poll loop.1 parent 6d5d6c1 commit f01dc58
4 files changed
Lines changed: 70 additions & 32 deletions
File tree
- stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose
- robots
- tests
- stream-chat-android-e2e-test/src/main/kotlin/io/getstream/chat/android/e2e/test/uiautomator
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
Lines changed: 12 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 122 | + | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
| |||
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
| 144 | + | |
147 | 145 | | |
148 | 146 | | |
149 | 147 | | |
| |||
231 | 229 | | |
232 | 230 | | |
233 | 231 | | |
234 | | - | |
| 232 | + | |
235 | 233 | | |
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
240 | | - | |
241 | | - | |
| 238 | + | |
242 | 239 | | |
243 | 240 | | |
244 | 241 | | |
| |||
268 | 265 | | |
269 | 266 | | |
270 | 267 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 268 | + | |
275 | 269 | | |
276 | 270 | | |
277 | 271 | | |
278 | 272 | | |
279 | 273 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 274 | + | |
| 275 | + | |
284 | 276 | | |
285 | 277 | | |
286 | 278 | | |
287 | 279 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 280 | + | |
| 281 | + | |
292 | 282 | | |
293 | 283 | | |
294 | 284 | | |
| |||
352 | 342 | | |
353 | 343 | | |
354 | 344 | | |
355 | | - | |
| 345 | + | |
356 | 346 | | |
357 | 347 | | |
358 | 348 | | |
359 | 349 | | |
360 | 350 | | |
361 | 351 | | |
362 | 352 | | |
363 | | - | |
| 353 | + | |
364 | 354 | | |
365 | 355 | | |
366 | 356 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
564 | 563 | | |
565 | 564 | | |
566 | 565 | | |
| |||
Lines changed: 54 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
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 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | | - | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
34 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
35 | 55 | | |
36 | 56 | | |
37 | 57 | | |
| |||
44 | 64 | | |
45 | 65 | | |
46 | 66 | | |
47 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
48 | 78 | | |
49 | 79 | | |
50 | 80 | | |
51 | | - | |
| 81 | + | |
52 | 82 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
56 | 92 | | |
57 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
58 | 104 | | |
59 | 105 | | |
60 | 106 | | |
| |||
0 commit comments