Skip to content

Commit

Permalink
inline menu now can be selected
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Mar 10, 2020
1 parent 6c7e7bf commit 03904f1
Showing 1 changed file with 32 additions and 7 deletions.
Expand Up @@ -45,24 +45,49 @@ public InlineMenu<T> caret() {
public List<String> getItems() {
List<String> items = new ArrayList<>();

ElementsCollection lis = getParentElement().findAll("div.btn-group ul.dropdown-menu li");
for (SelenideElement li : lis) {
// li.find()
ElementsCollection lis = getParentElement().findAll("div.btn-group ul.dropdown-menu li a");
for (SelenideElement a : lis) {
if (!a.isDisplayed()) {
continue;
}

String txt = a.getText();
if (txt != null) {
items.add(txt.trim());
}
}
// todo implement

return items;
}

public List<String> getItemKeys() {
// todo implement
return null;
List<String> items = new ArrayList<>();

ElementsCollection lis = getParentElement().findAll("div.btn-group ul.dropdown-menu li a schrodinger[data-s-resource-key]");
for (SelenideElement schrodinger : lis) {
if (!schrodinger.parent().isDisplayed()) {
continue;
}

String key = schrodinger.getAttribute("data-s-resource-key");
if (key != null) {
items.add(key.trim());
}
}

return items;
}

public InlineMenu<T> clickItem(String itemName) {
public InlineMenu<T> clickItemByName(String itemName) {
// todo implement
SelenideElement dropdown = getParentElement().find("div.btn-group ul.dropdown-menu li");

return this;
}

public InlineMenu<T> clickItemByKey(String itemKey) {
// todo implement

return this;
}
}

0 comments on commit 03904f1

Please sign in to comment.