Skip to content
Snippets Groups Projects
Commit 9e4eadda authored by Simon Urli's avatar Simon Urli
Browse files

XWIKI-22340: DeletePageIT.deleteOkWhenConfirming is flickering

  * Really wait for the end of the drawer menu transition to perform any
    operation
parent 15728e11
No related branches found
No related tags found
No related merge requests found
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
*/ */
package org.xwiki.test.ui.po; package org.xwiki.test.ui.po;
import org.apache.commons.lang3.mutable.MutableInt;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
/** /**
...@@ -112,18 +112,20 @@ private String getEntryXPath(String entryName) ...@@ -112,18 +112,20 @@ private String getEntryXPath(String entryName)
private void waitForDrawer(boolean visible) private void waitForDrawer(boolean visible)
{ {
// We always want the transition to be ended in the wait condition.
ExpectedCondition<Boolean> transitionEnded = ExpectedConditions.not(
ExpectedConditions.attributeContains(this.drawerContainer, "class", "drawer-transitioning")
);
if (visible) { if (visible) {
getDriver().waitUntilCondition(ExpectedConditions.visibilityOf(this.drawerContainer)); getDriver().waitUntilCondition(ExpectedConditions.and(
// Wait for the x position of the drawer container to be stable. ExpectedConditions.visibilityOf(this.drawerContainer),
MutableInt x = new MutableInt(this.drawerContainer.getLocation().getX()); transitionEnded
getDriver().waitUntilCondition(driver -> { ));
int newX = this.drawerContainer.getLocation().getX();
boolean isStable = newX == x.intValue();
x.setValue(newX);
return isStable;
});
} else { } else {
getDriver().waitUntilCondition(ExpectedConditions.invisibilityOf(this.drawerContainer)); getDriver().waitUntilCondition(ExpectedConditions.and(
ExpectedConditions.invisibilityOf(this.drawerContainer),
transitionEnded
));
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment