Skip to content

Commit 2d64fdc

Browse files
author
aquality-automation
authored
Refactor combobox remove redundant elementfinder #9 (#37)
* refactored state of elements * re-check waitForNotExists methods for correct work. split 1 test to 2, added verification of wait time * removed IElementWithState interface changed IElementStateProvider interface: added methods for waitings with default condition timeouts excluded ability to call state methods directly from elements, now users have to use state() method * refactored conditional wait refactored elements' states added isClickable * removed redundant ElementFinder usage from getSelectedText() and getValuesList() #9
1 parent 8c9ef0a commit 2d64fdc

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/main/java/aquality/selenium/elements/ComboBox.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,12 @@ public void clickAndSelectByValue(String value) {
9696

9797
@Override
9898
public String getSelectedText() {
99-
if(ElementFinder.getInstance().findElements(getLocator(), getDefaultTimeout(), getElementState()).isEmpty()) {
100-
throw new IllegalStateException(String.format(getLocManager().getValue("loc.element.wasnotfoundinstate"), getName(), getElementState(), getDefaultTimeout()));
101-
}
10299
return ElementActionRetrier.doWithRetry(() -> new Select(getElement()).getFirstSelectedOption().getText());
103100
}
104101

105102
@Override
106103
public List<String> getValues() {
107104
getLogger().info(getLocManager().getValue("loc.combobox.get.values"));
108-
if(ElementFinder.getInstance().findElements(getLocator(), getDefaultTimeout(), getElementState()).isEmpty()){
109-
throw new IllegalStateException(String.format(getLocManager().getValue("loc.element.wasnotfoundinstate"), getName(), getElementState(), getDefaultTimeout()));
110-
}
111105
return ElementActionRetrier.doWithRetry(() ->
112106
new Select(getElement()).getOptions()
113107
.stream()

0 commit comments

Comments
 (0)