Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Mar 14, 2020
2 parents 36d82ad + 0dc2801 commit da62167
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
11 changes: 7 additions & 4 deletions tools/schrodinger/pom.xml
Expand Up @@ -53,13 +53,16 @@
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</dependency>
<dependency>
<groupId>dnsjava</groupId>
<artifactId>dnsjava</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Expand Up @@ -18,6 +18,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.SelenideElement;
Expand Down Expand Up @@ -79,14 +80,31 @@ public List<String> getItemKeys() {
}

public InlineMenu<T> clickItemByName(String itemName) {
// todo implement
SelenideElement dropdown = getParentElement().find("div.btn-group ul.dropdown-menu li");
boolean found = false;
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 (Objects.equals(itemName, txt.trim())) {
a.parent().click();
found = true;
break;
}
}

if (!found) {
throw new IllegalStateException("Couldn't find item by name " + itemName);
}

return this;
}

public InlineMenu<T> clickItemByKey(String itemKey) {
// todo implement
SelenideElement element = getParentElement().find("div.btn-group ul.dropdown-menu li a schrodinger[data-s-resource-key=" + itemKey + "]");
element.parent().click();

return this;
}
Expand Down
Expand Up @@ -14,7 +14,8 @@
import com.evolveum.midpoint.schrodinger.SchrodingerException;
import com.evolveum.midpoint.schrodinger.component.Component;
import com.evolveum.midpoint.schrodinger.util.Schrodinger;
import org.jsoup.helper.Validate;

import org.apache.commons.lang3.Validate;
import org.openqa.selenium.By;

/**
Expand Down

0 comments on commit da62167

Please sign in to comment.