From 77dd486269bb11f1e206114b87033a7dcc58c012 Mon Sep 17 00:00:00 2001 From: Alexey Sandler Date: Thu, 5 Dec 2019 17:04:45 +0200 Subject: Changing VNF platform to multiselect + cypress + API Issue-ID: VID-724 Signed-off-by: Yoav Schneiderman Change-Id: Ie8c720974da3419e26ce7e8675622f75780581b9 Signed-off-by: Yoav Schneiderman --- .../java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vid-automation/src/main/java/org') diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java index b10636bf1..e834c15ac 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java @@ -475,6 +475,18 @@ public final class GeneralUIUtils { return element; } + public static boolean isOptionSelectedInMultiSelect(String dataTestId, String option) { + GeneralUIUtils.ultimateWait(); + List selectedElements = getDriver().findElements(By.xpath("//*[@data-tests-id='" + dataTestId + "']//span[@class='c-label']")); + + + for (WebElement selectedElement : selectedElements) { + if (selectedElement.getText().equals(option)) { + return true; + } + } + return false; + } public static WebElement getSelectedElementFromDropDown(String dataTestId){ GeneralUIUtils.ultimateWait();; WebElement selectedElement = new Select (getDriver().findElement(By.xpath("//*[@data-tests-id='" + dataTestId + "']"))).getFirstSelectedOption(); -- cgit 1.2.3-korg