Search in sources :

Example 16 with ElementsCollection

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");
        }
    }
}
Also used : Connections(io.syndesis.qe.pages.connections.Connections) ElementsCollection(com.codeborne.selenide.ElementsCollection) ConfigureConnectionSteps(io.syndesis.qe.steps.connections.wizard.phases.ConfigureConnectionSteps) NameConnectionSteps(io.syndesis.qe.steps.connections.wizard.phases.NameConnectionSteps) ArrayList(java.util.ArrayList) List(java.util.List) Given(cucumber.api.java.en.Given)

Example 17 with ElementsCollection

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);
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection)

Example 18 with ElementsCollection

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();
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection)

Example 19 with ElementsCollection

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;
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection) SelenideElement(com.codeborne.selenide.SelenideElement)

Example 20 with ElementsCollection

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));
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection)

Aggregations

ElementsCollection (com.codeborne.selenide.ElementsCollection)31 SelenideElement (com.codeborne.selenide.SelenideElement)15 ArrayList (java.util.ArrayList)9 Then (cucumber.api.java.en.Then)4 When (cucumber.api.java.en.When)2 StepComponent (io.syndesis.qe.pages.integrations.edit.steps.StepComponent)2 Given (cucumber.api.java.en.Given)1 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)1 Connections (io.syndesis.qe.pages.connections.Connections)1 BasicFilterStepComponent (io.syndesis.qe.pages.integrations.edit.steps.BasicFilterStepComponent)1 ConfigureConnectionSteps (io.syndesis.qe.steps.connections.wizard.phases.ConfigureConnectionSteps)1 NameConnectionSteps (io.syndesis.qe.steps.connections.wizard.phases.NameConnectionSteps)1 List (java.util.List)1