| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
codeceptjs#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>
There was a problem hiding this comment.
I reviewed the change across Playwright, Puppeteer, and WebDriver. Passing the raw fragment to waitInUrl restores substring matching while waitUrlEquals continues to resolve full URLs. This also covers query-only fragments such as user=test.
The changed files pass ESLint and git diff --check. The local unit suite produced the same result on this commit and a clean 4.x checkout: 758 passed, 11 failed, and 11 skipped. The relevant Playwright, Puppeteer, and WebDriver checks are green. I did not find an issue in the patch.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Motivation/Description of the PR
#5451 introduced resolveUrl() and wired it into waitInUrl alongside waitUrlEquals. For waitUrlEquals that is correct — a strict comparison genuinely needs the relative path resolved against the configured base url. For waitInUrl it silently turned a substring match into an origin-anchored one:
This also contradicts the method's own docs — docs/webapi/waitInUrl.mustache ("Waiting for the part of the URL to match the expected") and docs/migration-4.md, which literally states I.waitInUrl('/users') "matches any URL containing /users". The docs described the old behavior; only the code changed.
Fix: waitInUrl compares against the raw urlPart again in Playwright, Puppeteer and WebDriver, and reports it unresolved in the timeout message. resolveUrl imports stay — waitUrlEquals still uses them.
This is strictly more permissive than current 4.x for every realistic input (resolveUrl('/x', base) always ends in /x, so anything matching the resolved form also matches the raw form), so no currently-passing usage regresses.
waitUrlEquals is deliberately untouched. #5451 also tightened it from substring to strict equality in Playwright/Puppeteer; that matches the method's name, its docs and WebDriver's long-standing behavior, so it is out of scope here.
No issue was filed for this — it was found while upgrading. Resolves the waitInUrl half of the behavior change in #5451.
Applicable helpers:
Applicable plugins:
Type of change
Checklist:
Notes on the two unchecked boxes:
Testing
The existing test placed its assert only inside catch, so it passed vacuously whenever the wait unexpectedly succeeded — which is how this regression shipped. It now fails on a missing timeout, and a new case pins the bug.
Reverting only the helper change reproduces the regression in its own words:
Verified locally against the PHP test app:
The WebDriver leg was run through webdriverio's self-managed chromedriver rather than the Selenium container, which cannot complete its BiDi websocket handshake through Docker Desktop on macOS; CI covers the Selenium path.
🤖 Generated with Claude Code