From edd8b9bd16a33fe6be3e5082c953aaf374884070 Mon Sep 17 00:00:00 2001 From: elmot Date: Wed, 14 Sep 2016 12:13:14 +0300 Subject: Test and fix a CheckBoxGroup icon provider and item enabled provider Change-Id: Ia3ed99478d19efc041cc4adaabd856ee69f3531b --- .../customelements/CheckBoxGroupElement.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'uitest-common') diff --git a/uitest-common/src/main/java/com/vaadin/testbench/customelements/CheckBoxGroupElement.java b/uitest-common/src/main/java/com/vaadin/testbench/customelements/CheckBoxGroupElement.java index b2dd93a7b0..9b234fa1cd 100644 --- a/uitest-common/src/main/java/com/vaadin/testbench/customelements/CheckBoxGroupElement.java +++ b/uitest-common/src/main/java/com/vaadin/testbench/customelements/CheckBoxGroupElement.java @@ -46,6 +46,30 @@ public class CheckBoxGroupElement extends AbstractSelectElement { return optionTexts; } + public List getOptionsCssClasses() { + List optionTexts = new ArrayList<>(); + List options = findElements(byButtonSpan); + for (WebElement option : options) { + optionTexts.add(option.getAttribute("class")); + } + return optionTexts; + } + + public List getOptionsIconUrls() { + List icons = new ArrayList<>(); + List options = findElements(byButtonSpan); + for (WebElement option : options) { + List images = option.findElements(By.tagName("img")); + if (images != null && images.size() > 0) { + icons.add(images.get(0).getAttribute("src")); + } else { + icons.add(null); + } + + } + return icons; + } + public void selectByText(String text) throws ReadOnlyException { if (isReadOnly()) { throw new ReadOnlyException(); @@ -103,4 +127,5 @@ public class CheckBoxGroupElement extends AbstractSelectElement { "Clear operation is not supported for CheckBoxGroup." + " This operation has no effect on the element."); } + } -- cgit v1.2.3