test: wait for the new page after forms that redirect to the same URL - #155
Merged
Merged
Conversation
RenzoMinelli
marked this pull request as draft
September 25, 2026 19:04
RenzoMinelli
force-pushed
the
rm--retry-detached-node-errors
branch
from
September 25, 2026 19:20
2c03777 to
cdd87fa
Compare
`have_current_path` passes before the navigation starts when the target URL equals the current one, so the next query could hit a node from the old page and fail with ChromeDriver's detached-node error. The helper clicks and waits until `performance.timeOrigin` changes. Waiting exposed that a failed 2FA attempt re-renders at the POST URL instead of redirecting, so that spec now asserts the real path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RenzoMinelli
force-pushed
the
rm--retry-detached-node-errors
branch
from
September 25, 2026 19:50
cdd87fa to
fe6beef
Compare
RenzoMinelli
marked this pull request as ready for review
September 25, 2026 19:52
RenzoMinelli
force-pushed
the
rm--retry-detached-node-errors
branch
from
September 25, 2026 19:56
fe6beef to
8deb78d
Compare
RenzoMinelli
force-pushed
the
rm--retry-detached-node-errors
branch
from
September 25, 2026 20:18
8deb78d to
fe6beef
Compare
santiagorodriguez96
approved these changes
Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Adds
click_button_and_wait_for_page_load, which clicks and waits untilperformance.timeOriginchanges. Six system specs whose form redirects back to the same URL use it. A failed 2FA attempt re-renders at the POST URL, so that spec now asserts the real path.Why:
have_current_pathpasses before the new page loads when the URL doesn't change. Any query during the page swap can then hit an open ChromeDriver bug, which Capybara does not retry.How it works:
performance.timeOriginis the time the browser started loading the current page, so every new page has a different value. The helper reads it, clicks, then uses Capybara'ssynchronizeto retry the check until the value changes. Browser errors during the page swap are retried inside that wait.Evidence:
have_current_pathonly waits for the URL: teamcapybara/capybara#1460How to test: CI is green.