Commit 75f1221
fix(helpers): restore substring matching in waitInUrl (#5682)
#5451 wired resolveUrl() into waitInUrl alongside waitUrlEquals. For
waitUrlEquals that is correct — a strict comparison needs the relative path
resolved against the configured base url. For waitInUrl it silently turned a
documented substring match into an origin-anchored one:
const expectedUrl = resolveUrl(urlPart, this.options.url) // '/users' -> 'https://app.example.com/users'
return currUrl.indexOf(expectedUrl) > -1 // scheme+host+port must now match exactly
So I.waitInUrl('/users') breaks after a redirect to a different host, port or
scheme, and a partial match such as I.waitInUrl('user=test') resolves to
<base>/user=test and never matches /info?user=test.
Compare against the raw urlPart again in Playwright, Puppeteer and WebDriver.
waitUrlEquals is left untouched.
The existing test asserted only inside catch, so it passed vacuously whenever
the wait unexpectedly succeeded — which is how this shipped. It now fails on a
missing timeout, plus a new case pinning the regression.
docs/migration-4.md listed waitInUrl among the methods that resolve relative
urls while its own example said the opposite; corrected.
Co-authored-by: Claude <claude@anthropic.com>1 parent 6ac157e commit 75f1221
5 files changed
Lines changed: 23 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
| 617 | + | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
| 626 | + | |
| 627 | + | |
626 | 628 | | |
627 | 629 | | |
628 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3423 | 3423 | | |
3424 | 3424 | | |
3425 | 3425 | | |
3426 | | - | |
3427 | 3426 | | |
3428 | 3427 | | |
3429 | 3428 | | |
3430 | 3429 | | |
3431 | 3430 | | |
3432 | 3431 | | |
3433 | 3432 | | |
3434 | | - | |
| 3433 | + | |
3435 | 3434 | | |
3436 | 3435 | | |
3437 | 3436 | | |
3438 | 3437 | | |
3439 | 3438 | | |
3440 | | - | |
| 3439 | + | |
3441 | 3440 | | |
3442 | 3441 | | |
3443 | 3442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2501 | 2501 | | |
2502 | 2502 | | |
2503 | 2503 | | |
2504 | | - | |
2505 | 2504 | | |
2506 | 2505 | | |
2507 | 2506 | | |
| |||
2510 | 2509 | | |
2511 | 2510 | | |
2512 | 2511 | | |
2513 | | - | |
| 2512 | + | |
2514 | 2513 | | |
2515 | 2514 | | |
2516 | 2515 | | |
2517 | 2516 | | |
2518 | | - | |
| 2517 | + | |
2519 | 2518 | | |
2520 | 2519 | | |
2521 | 2520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2521 | 2521 | | |
2522 | 2522 | | |
2523 | 2523 | | |
2524 | | - | |
2525 | 2524 | | |
2526 | 2525 | | |
2527 | 2526 | | |
2528 | 2527 | | |
2529 | 2528 | | |
2530 | 2529 | | |
2531 | 2530 | | |
2532 | | - | |
| 2531 | + | |
2533 | 2532 | | |
2534 | 2533 | | |
2535 | 2534 | | |
2536 | 2535 | | |
2537 | 2536 | | |
2538 | 2537 | | |
2539 | 2538 | | |
2540 | | - | |
| 2539 | + | |
2541 | 2540 | | |
2542 | 2541 | | |
2543 | 2542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
154 | 159 | | |
155 | | - | |
156 | | - | |
157 | 160 | | |
158 | 161 | | |
159 | | - | |
| 162 | + | |
160 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
161 | 172 | | |
162 | 173 | | |
163 | 174 | | |
| |||
0 commit comments