Skip to content
Snippets Groups Projects
Commit ce176320 authored by Michael Hamann's avatar Michael Hamann
Browse files

XWIKI-21687: LoginIT.loginLogoutAsAdmin(TestUtils, TestReference) and...

XWIKI-21687: LoginIT.loginLogoutAsAdmin(TestUtils, TestReference) and LoginIT.loginWithInvalidCredentials(LogCaptureConfiguration) are flickering

* Use the same condition for `isVisible` as for the waiting when
  opening/closing the drawer. This ensures that if you call `isVisible`
  after opening/closing the drawer, you get the expected result.
* Wait for the x-position of the drawer to be stable when opening the
  drawer to ensure that the opening animation is finished.
parent 00096e66
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@
*/
package org.xwiki.test.ui.po;
import org.apache.commons.lang3.mutable.MutableInt;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
......@@ -52,7 +53,7 @@ public void toggle()
public boolean isVisible()
{
return "true".equals(this.activator.getAttribute("aria-expanded"));
return this.drawerContainer.isDisplayed();
}
public boolean show()
......@@ -113,6 +114,14 @@ private void waitForDrawer(boolean visible)
{
if (visible) {
getDriver().waitUntilCondition(ExpectedConditions.visibilityOf(this.drawerContainer));
// Wait for the x position of the drawer container to be stable.
MutableInt x = new MutableInt(this.drawerContainer.getLocation().getX());
getDriver().waitUntilCondition(driver -> {
int newX = this.drawerContainer.getLocation().getX();
boolean isStable = newX == x.intValue();
x.setValue(newX);
return isStable;
});
} else {
getDriver().waitUntilCondition(ExpectedConditions.invisibilityOf(this.drawerContainer));
}
......
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