diff options
Diffstat (limited to 'testbench-api/src')
-rw-r--r-- | testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java index b91f3994d1..3c274b99f1 100644 --- a/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java +++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java @@ -25,6 +25,7 @@ import com.vaadin.testbench.elementsbase.ServerClass; @ServerClass("com.vaadin.ui.AbstractComponent") public class AbstractComponentElement extends AbstractElement { + /** * Returns the caption of the Component element. * @@ -32,16 +33,16 @@ public class AbstractComponentElement extends AbstractElement { * @return component caption */ public String getCaption() { - final String GWT_ID_ATTRIBUTE = "aria-labelledby"; + final String gwtIdAttribute = "aria-labelledby"; WebElement captElem = null; String captionId = null; - captionId = getAttribute(GWT_ID_ATTRIBUTE); + captionId = getAttribute(gwtIdAttribute); // IE8 getAttribute returns empty string instead of null // when there is no attribute with specified name if (captionId == null || captionId.isEmpty()) { WebElement elem = findElement( - By.xpath(".//*[@" + GWT_ID_ATTRIBUTE + "]")); - captionId = elem.getAttribute(GWT_ID_ATTRIBUTE); + By.xpath(".//*[@" + gwtIdAttribute + "]")); + captionId = elem.getAttribute(gwtIdAttribute); } // element ids are unique, we can search the whole page captElem = getDriver().findElement(By.id(captionId)); @@ -53,12 +54,11 @@ public class AbstractComponentElement extends AbstractElement { } public boolean isReadOnly() { - final String READONLY_CSS_CLASS = "v-readonly"; String readonlyClass = getAttribute("class"); // looking for READONLY_CSS_CLASS string String[] cssSelectors = readonlyClass.split("\\s"); for (String selector : cssSelectors) { - if (selector.equals(READONLY_CSS_CLASS)) { + if (selector.equals("v-readonly")) { return true; } } |