Skip to content

Commit 5f04f45

Browse files
committed
Fix AppMenu.open with Chrome driver
1 parent 43a74e6 commit 5f04f45

File tree

1 file changed

+11
-3
lines changed
  • modules/web/src/main/java/com/haulmont/masquerade/components/impl

1 file changed

+11
-3
lines changed

modules/web/src/main/java/com/haulmont/masquerade/components/impl/AppMenuImpl.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.haulmont.masquerade.components.impl;
1818

19+
import com.codeborne.selenide.SelenideElement;
1920
import com.haulmont.masquerade.Components;
2021
import com.haulmont.masquerade.components.AppMenu;
2122
import org.openqa.selenium.By;
@@ -25,6 +26,8 @@
2526
import static com.codeborne.selenide.Condition.visible;
2627
import static com.codeborne.selenide.Selectors.byXpath;
2728
import static com.codeborne.selenide.Selenide.$;
29+
import static com.codeborne.selenide.Selenide.Wait;
30+
import static org.openqa.selenium.support.ui.ExpectedConditions.elementToBeClickable;
2831

2932
public class AppMenuImpl extends AbstractComponent<AppMenu> implements AppMenu {
3033

@@ -50,10 +53,15 @@ public void openItem(String... path) {
5053
String itemXpath = "//span[contains(@class, 'v-menubar-menuitem') " +
5154
"and @cuba-id=" + Quotes.escape(s) + "]";
5255

53-
$(byXpath(itemXpath))
56+
SelenideElement menuItemElement = $(byXpath(itemXpath));
57+
58+
menuItemElement
5459
.shouldBe(visible)
55-
.shouldBe(enabled)
56-
.click();
60+
.shouldBe(enabled);
61+
62+
Wait().until(elementToBeClickable(menuItemElement));
63+
64+
menuItemElement.click();
5765
}
5866
}
5967
}

0 commit comments

Comments
 (0)