Skip to content

Commit

Permalink
added doCheckInMenu(String option, SearchType... searchTypes) method …
Browse files Browse the repository at this point in the history
…in Menu.java
  • Loading branch information
vculea committed Oct 29, 2024
1 parent 48a38d1 commit 7c4c723
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/sdl/selenium/extjs6/menu/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public boolean checkInMenu(String option, SearchType... searchTypes) {
return item.check(true);
}

public boolean doCheckInMenu(String option, SearchType... searchTypes) {
ready();
Item item = new Item(this, option, searchTypes);
return item.doCheck(true);
}

public boolean mouseOverOnMenu(String option, SearchType... searchTypes) {
ready();
return getWebLink(this, option, searchTypes).mouseOver();
Expand Down Expand Up @@ -238,6 +244,7 @@ public class Item extends WebLocator implements ICheck {

public Item(WebLocator container, String option, SearchType... searchTypes) {
WebLink link = getWebLink(null, option, searchTypes);
setContainer(container);
setClasses("x-menu-item").setChildNodes(link);
itemLink = getWebLink(container, option, searchTypes);
setVisibility(true);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/sdl/selenium/web/XPathBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1232,11 +1232,11 @@ private String getItemCssSelector() {
selectors.add("[class=" + getCls() + "]");
}
if (hasClasses()) {
selectors.addAll(getClasses().stream().map(cls -> "." + cls).collect(Collectors.toList()));
selectors.addAll(getClasses().stream().map(cls -> "." + cls).toList());
}
if (hasExcludeClasses()) {
// LOGGER.warn("excludeClasses is not supported yet");
selectors.addAll(getExcludeClasses().stream().map(excludeClass -> ":not(." + excludeClass + ")").collect(Collectors.toList()));
selectors.addAll(getExcludeClasses().stream().map(excludeClass -> ":not(." + excludeClass + ")").toList());
}
if (hasName()) {
selectors.add("[name='" + getName() + "']");
Expand All @@ -1247,7 +1247,7 @@ private String getItemCssSelector() {
if (!attribute.isEmpty()) {
selectors.addAll(attribute.entrySet().stream()
.map(e -> "[" + e.getKey() + "='" + e.getValue().getValue() + "']")
.collect(Collectors.toList()));
.toList());
}
// for (Map.Entry<String, String> entry : getTemplatesValues().entrySet()) {
// addTemplate(selector, entry.getKey(), entry.getValue());
Expand Down

0 comments on commit 7c4c723

Please sign in to comment.