diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-26 13:26:20 +0200 |
---|---|---|
committer | Pekka Maanpää <pekkamaa@vaadin.com> | 2017-10-26 14:26:20 +0300 |
commit | 10bd7544fd22dccd7e8e32cb236eb50f102892d3 (patch) | |
tree | d0e6f2241dc2b612a0deeceeb30399e88e47ed6a /testbench-api/src/main/java/com | |
parent | 7c8f440781835dbcf72bfbc47ab8be2f669a40e4 (diff) | |
download | vaadin-framework-10bd7544fd22dccd7e8e32cb236eb50f102892d3.tar.gz vaadin-framework-10bd7544fd22dccd7e8e32cb236eb50f102892d3.zip |
Improve naming of fields and variables (#10242)
* Variable names to conform to naming convention.
* Use static constants where it makes sense
Diffstat (limited to 'testbench-api/src/main/java/com')
-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; } } |