Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
18.4.5
-
Unknown
-
-
org.xwiki.flamingo.test.docker.AllIT$NestedCopyPageIT#copyDoesNotCarryOverRightsTheUserCannotGrant
Description
The functional test org.xwiki.flamingo.test.docker.AllIT$NestedCopyPageIT#copyDoesNotCarryOverRightsTheUserCannotGrant fails intermittently on ci.xwiki.org.
Occurrence
- Seen in https://ci.xwiki.org/job/XWiki%20Environment%20Tests/job/xwiki-platform/job/stable-18.4.x/139/testReport/ (commit 89eec5c383f), environment: MySQL latest, Tomcat 11-jdk25, filesystem blob store, Chrome (WCAG validation on).
- History: 1 failure in 34 builds (stable-18.4.x main + environment jobs); passes on master, stable-18.8.x and stable-17.10.x.
- Local verification on 89eec5c383f: the whole module passed with the CI Maven options, and the test passed 20/20 when repeated alone.
Error
org.openqa.selenium.JavascriptException: javascript error: Cannot read properties of undefined (reading 'runPartial') at org.xwiki.test.ui.XWikiWebDriver.executeScript(XWikiWebDriver.java:814) at org.xwiki.test.ui.po.BasePage.validateWCAG(BasePage.java:719) at org.xwiki.test.ui.po.BasePage.validateWCAG(BasePage.java:694) at org.xwiki.test.ui.po.BasePage.validateWCAG(BasePage.java:683) at org.xwiki.test.ui.po.BasePage.<init>(BasePage.java:139) at org.xwiki.test.ui.po.RefactoringStatusPage.<init>(RefactoringStatusPage.java:32) at org.xwiki.test.ui.po.CopyOrRenameOrDeleteStatusPage.<init>(CopyOrRenameOrDeleteStatusPage.java:33) at org.xwiki.test.ui.po.CopyPage.clickCopyButton(CopyPage.java:177)
Analysis
CopyPage#clickCopyButton() submits the form and immediately builds a CopyOrRenameOrDeleteStatusPage, without waiting for the page to be reloaded. The BasePage constructor then runs the WCAG validation (axe-core) while the browser is navigating, and axe.runPartial is called on a document where axe is no longer defined, hence Cannot read properties of undefined (reading 'runPartial'). The rights logic under test is not involved.
This is the same failure and the same cause as XWIKI-20767, fixed in TemplatesAdministrationSectionPage by calling getDriver().addPageNotYetReloadedMarker() before the click and getDriver().waitUntilPageIsReloaded() after it.
Possible fix
Apply the XWIKI-20767 pattern in CopyPage#clickCopyButton(), which fixes every test using it.