XWIKI-24807: AdministrationSectionPage#clickSave() doesn't wait for the page reload, causing flickering StaleElementReferenceException in administration UI tests - #6313
Merged
Conversation
…he page reload, causing flickering StaleElementReferenceException in administration UI tests * clickSave(boolean) now synchronizes on the full-page reload triggered by a non-async section's save button, using the existing addPageNotYetReloadedMarker()/waitUntilPageIsReloaded() idiom, instead of returning immediately after the click * this avoids a race where a caller reading back the saved value right after clickSave() can hit a stale element from the page being unloaded Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
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.



Jira URL
https://jira.xwiki.org/browse/XWIKI-24807
Changes
Description
AdministrationSectionPage#clickSave(boolean)now waits for the full-page reload triggered by anon-async administration section's save button (using the existing
addPageNotYetReloadedMarker()/waitUntilPageIsReloaded()idiom) instead of returning right afterthe click.
Clarifications
XWikiWebDriver#findElement(By)resolves the element then callsscrollTo()(a separate
executeScript()call). If the save's full-page reload tears down the DOM in thewindow between those two calls, the element reference goes stale and the next page-object call
throws
StaleElementReferenceException. This affects every non-async administration section, notjust Presentation, since they all share this
clickSave()code path.fluke): the same failure, at the same line, recurs in isolation across independent builds with
different Chrome/JDK combinations. See XWIKI-24807 for the full analysis.
Screenshots & Video
N/A — no UI change, this only affects test synchronization.
Executed Tests
mvn clean install -B -ntp -Plegacy -pl xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-pageobjects— green (Checkstyle, license, Spoon all pass).PresentationITdocker IT class withshowPageAttachmentsTabrepeated 10 times,against Tomcat 11/jdk25 + PostgreSQL + Chrome (matching the failing CI job): 15/15 executions
passed,
BUILD SUCCESS.Expected merging strategy
🤖 Generated with Claude Code