Search in sources :

Example 1 with Connections

use of io.syndesis.qe.pages.connections.Connections 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)

Aggregations

ElementsCollection (com.codeborne.selenide.ElementsCollection)1 Given (cucumber.api.java.en.Given)1 Connections (io.syndesis.qe.pages.connections.Connections)1 ConfigureConnectionSteps (io.syndesis.qe.steps.connections.wizard.phases.ConfigureConnectionSteps)1 NameConnectionSteps (io.syndesis.qe.steps.connections.wizard.phases.NameConnectionSteps)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1