Repository navigation
AP-945: Handle Chrome stale-document visibility errors - #69
Merged
Merged
Conversation
Makes Capybara translate UnknownErrors raised by Chrome having to do with selected elements being stale (not in the current version of the DOM) to a retryable StaleElementReferenceError, resolving flakey tests. Co-Authored-By: Codex <codex@openai.com> Signed-off-by: Daniel Schmidt <danschmidt5189@berkeley.edu>
danschmidt5189
force-pushed
the
AP-945-browser-synchronization
branch
from
November 20, 2026 19:00
6dcff1f to
7d3bfa0
Compare
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.
Chrome sometimes reports
Node with given id does not belong to the documentas SeleniumUnknownErrorduring element visibility checks. Capybara does not classify this as a stale element, so post-submit assertions fail instead of reloading the element. Observed failures include TIND validation, faculty/DSP proxy-borrower validation, and reference-card approval; see the main-branch failure.Add a test-only Chrome visibility workaround that translates only that specific error into
StaleElementReferenceError. Capybara then uses its existing bounded reload/retry behavior; unrelated errors propagate. Original form assertions are preserved. Pin Selenium to the readable release tag4.53.0-20261120(Chromium 156.0.8078.79).Validation on local ARM64 Docker with pinned Chromium:
UnknownErrorexceptions propagate.No application behavior changes, added sleeps, or whole-test retries.