use of com.codeborne.selenide.ElementsCollection in project syndesis-qe by syndesisio.
the class CommonSteps method createConnections.
@Given("^created connections$")
public void createConnections(DataTable connectionsData) {
Connections connectionsPage = new Connections();
ConfigureConnectionSteps configureConnectionSteps = new ConfigureConnectionSteps();
NameConnectionSteps nameConnectionSteps = new NameConnectionSteps();
List<List<String>> dataTable = connectionsData.raw();
for (List<String> dataRow : dataTable) {
String connectionType = dataRow.get(0);
String connectionCredentialsName = dataRow.get(1);
String connectionName = dataRow.get(2);
String connectionDescription = dataRow.get(3);
navigateTo("", "Connections");
validatePage("", "Connections");
ElementsCollection connections = connectionsPage.getAllConnections();
connections = connections.filter(exactText(connectionName));
if (connections.size() != 0) {
log.warn("Connection {} already exists!", connectionName);
} else {
clickOnButton("Create Connection");
selectConnectionTypeSteps.selectConnectionType(connectionType);
configureConnectionSteps.fillConnectionDetails(connectionCredentialsName);
clickOnButton("Validate");
successNotificationIsPresentWithError(connectionType + " has been successfully validated");
scrollTo("top", "right");
clickOnButton("Next");
nameConnectionSteps.setConnectionName(connectionName);
nameConnectionSteps.setConnectionDescription(connectionDescription);
clickOnButton("Create");
}
}
}
use of com.codeborne.selenide.ElementsCollection in project syndesis-qe by syndesisio.
the class SyndesisPageObject method getElementRandom.
public SelenideElement getElementRandom(By locator) {
ElementsCollection elements = this.getRootElement().findAll(locator);
int index = (int) Math.floor(Math.random() * elements.size());
return elements.get(index);
}
use of com.codeborne.selenide.ElementsCollection in project syndesis-qe by syndesisio.
the class SyndesisPageObject method getElementContainingText.
public SelenideElement getElementContainingText(By by, String text, SelenideElement differentRoot) {
ElementsCollection elements = differentRoot.shouldBe(visible).findAll(by).shouldBe(sizeGreaterThan(0));
log.info("I found " + elements.size() + " elements.");
elements = elements.filter(exactText(text));
log.info("Elements after filter: " + elements.size());
return elements.shouldBe(sizeGreaterThan(0)).first();
}
use of com.codeborne.selenide.ElementsCollection in project syndesis-qe by syndesisio.
the class TechExtensionsListComponent method getExtensionItem.
public SelenideElement getExtensionItem(String name) {
$(Element.LIST_WRAPPER).shouldBe(visible);
ElementsCollection items = $$(Element.ITEM);
SelenideElement resultItem = items.stream().filter(item -> item.find(Element.ITEM_TITLE).getText().equals(name)).findAny().orElse(null);
return resultItem;
}
use of com.codeborne.selenide.ElementsCollection in project syndesis-qe by syndesisio.
the class IntegrationActivityListComponent method clickOnActivity.
public void clickOnActivity(int order) {
ElementsCollection activities = this.getAllIntegrationActivities().shouldBe(sizeGreaterThan(0));
this.clickOnActivityExpander(activities.get(order));
}
Aggregations