← 输入框|github.com|刷新
Skip to content

AP-945: Handle Chrome stale-document visibility errors - #69

Merged
danschmidt5189 merged 1 commit into
mainfrom
AP-945-browser-synchronization
Nov 20, 2026
Merged

danschmidt5189 merged 1 commit into
mainfrom
AP-945-browser-synchronization

Conversation

@danschmidt5189

@danschmidt5189 danschmidt5189 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Chrome sometimes reports Node with given id does not belong to the document as Selenium UnknownError during 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 tag 4.53.0-20261120 (Chromium 156.0.8078.79).

Validation on local ARM64 Docker with pinned Chromium:

  • A deterministic browser regression test fails without the workaround and passes with it: inject the error on one native element, then assert that Capybara reloads it successfully.
  • A separate browser test confirms unrelated UnknownError exceptions propagate.
  • Both new browser tests and RuboCop for changed/new Ruby files pass.
  • Production image builds successfully; full RSpec suite passes twice consecutively: 769 examples, 0 failures per run.

No application behavior changes, added sleeps, or whole-test retries.

@danschmidt5189 danschmidt5189 changed the title AP-945: Stabilize post-submit validation system tests AP-945: Handle Chrome stale-document visibility errors Nov 20, 2026
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
danschmidt5189 force-pushed the AP-945-browser-synchronization branch from 6dcff1f to 7d3bfa0 Compare November 20, 2026 19:00
@danschmidt5189
danschmidt5189 merged commit 5a2a913 into main Nov 20, 2026
5 checks passed
@danschmidt5189
danschmidt5189 deleted the AP-945-browser-synchronization branch November 20, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant