Commit b67039e
authored
Reduce flakiness in several tests (#1487)
"does not fire turbo:load twice after following a redirect"
src/tests/functional/navigation_tests.js:451
The event can sometimes arrive slightly before the check. Count
events over the whole scenario rather than checking at a specific
moment, which is more robust and more closely matches the purpose
of the test.
"link method form submission targeting frame submits a single request"
src/tests/functional/form_submission_tests.js:1019
Redirect accounting differs between browsers—Firefox sometimes
won't count the redirect as a request, returning just 1. Stop
counting redirect requests. Instead, assert the redirect happened
by checking that the page contains content from the redirect
target, then verify a single request was made by counting only
the non-redirect requests.
"successfully following a link to a page without a matching frame
shows an error and throws an exception"
src/tests/functional/frame_tests.js:152
"failing to follow a link to a page without a matching frame shows
an error and throws an exception"
src/tests/functional/frame_tests.js:181
The assertion on the error can run before the error-setting
callback runs. Wait for the error to be set and the page click
to finish before continuing with assertions.
"reloads when tracked elements change"
src/tests/functional/rendering_tests.js:48
Since we're triggering a full page reload, it's possible to try
to evaluate on the page at the moment of navigation. This leads
to a race condition where the check is triggered as the page is
being navigated away and the evaluation happens after its context
was already destroyed, throwing "Execution context was destroyed,
most likely because of a navigation". Use Playwright's native
page.waitForURL instead of waiting for the turbo:load event,
since it doesn't rely on page evaluation and is resistant to
navigation issues.1 parent 26c5704 commit b67039e
3 files changed
Lines changed: 21 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | | - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
1022 | 1024 | | |
1023 | 1025 | | |
1024 | 1026 | | |
1025 | 1027 | | |
1026 | 1028 | | |
1027 | 1029 | | |
1028 | 1030 | | |
1029 | | - | |
| 1031 | + | |
| 1032 | + | |
1030 | 1033 | | |
1031 | 1034 | | |
1032 | 1035 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
452 | 457 | | |
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
456 | | - | |
457 | | - | |
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
461 | 467 | | |
462 | 468 | | |
463 | 469 | | |
| |||
0 commit comments