From 7c4c723a8952619a40de7532c80ebd4fd27f13f0 Mon Sep 17 00:00:00 2001 From: vculea Date: Tue, 29 Oct 2024 12:48:55 +0200 Subject: [PATCH] added doCheckInMenu(String option, SearchType... searchTypes) method in Menu.java --- src/main/java/com/sdl/selenium/extjs6/menu/Menu.java | 7 +++++++ src/main/java/com/sdl/selenium/web/XPathBuilder.java | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sdl/selenium/extjs6/menu/Menu.java b/src/main/java/com/sdl/selenium/extjs6/menu/Menu.java index 4a1d16d4..1df0a150 100644 --- a/src/main/java/com/sdl/selenium/extjs6/menu/Menu.java +++ b/src/main/java/com/sdl/selenium/extjs6/menu/Menu.java @@ -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(); @@ -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); diff --git a/src/main/java/com/sdl/selenium/web/XPathBuilder.java b/src/main/java/com/sdl/selenium/web/XPathBuilder.java index 357ed7cf..c97be09f 100644 --- a/src/main/java/com/sdl/selenium/web/XPathBuilder.java +++ b/src/main/java/com/sdl/selenium/web/XPathBuilder.java @@ -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() + "']"); @@ -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 entry : getTemplatesValues().entrySet()) { // addTemplate(selector, entry.getKey(), entry.getValue());