Skip to content

Commit

Permalink
added doRemoveAll() method
Browse files Browse the repository at this point in the history
  • Loading branch information
vculea committed Sep 2, 2024
1 parent e23b932 commit 60e1fe6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/com/sdl/selenium/extjs6/form/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ public boolean removeAll() {
return removed;
}

public boolean doRemoveAll() {
boolean removed;
WebLocator item = new WebLocator(list).setClasses("x-tagfield-item");
int size = item.size();
if(size > 0) {
WebLocator closeEl = new WebLocator(item).setClasses("x-tagfield-item-close");
removed = RetryUtils.retry(size, () -> closeEl.doClick() && !item.ready(Duration.ofMillis(500)));
} else {
removed = true;
}
return removed;
}

public boolean remove(String... values) {
boolean removed = true;
for (String value : values) {
Expand Down

0 comments on commit 60e1fe6

Please sign in to comment.