Search in sources :

Example 81 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class ExtensionSteps method importExtension.

@Given("^imported extensions$")
public void importExtension(DataTable extensionsData) throws Throwable {
    CommonSteps commonSteps = new CommonSteps();
    String extensionsLink = "Extensions";
    String importButton = "Import Extension";
    List<List<String>> dataTable = extensionsData.raw();
    for (List<String> dataRow : dataTable) {
        String extensionName = dataRow.get(0);
        String extensionFileName = dataRow.get(1);
        commonSteps.navigateTo("", "Customizations");
        commonSteps.validatePage("", "Customizations");
        commonSteps.clickOnLink(extensionsLink);
        commonSteps.validatePage("", "Extensions");
        SelenideElement techExtensionItem = techExtensionsListComponent.getExtensionItem(extensionName);
        if (techExtensionItem != null) {
            log.warn("Extension {} already exists!", extensionName);
        } else {
            commonSteps.clickOnButton(importButton);
            commonSteps.validatePage("", "Import Extension");
            uploadFile(extensionFileName);
            importDetails();
            commonSteps.clickOnButton(importButton);
            commonSteps.validatePage("", "Extension Details");
        }
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) CommonSteps(io.syndesis.qe.steps.CommonSteps) List(java.util.List) Given(cucumber.api.java.en.Given)

Example 82 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class DashboardSteps method expectConnectionTitlePresent.

@Then("^Camilla can see \"([^\"]*)\" connection on dashboard page$")
public void expectConnectionTitlePresent(String connectionName) {
    DashboardPage dashboardPage = new DashboardPage();
    SelenideElement connection = dashboardPage.getConnection(connectionName);
    connection.shouldBe(visible);
}
Also used : DashboardPage(io.syndesis.qe.pages.dashboard.DashboardPage) SelenideElement(com.codeborne.selenide.SelenideElement) Then(cucumber.api.java.en.Then)

Example 83 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class DataMapperSteps method combinePresentFielsWithAnother.

/**
 * @param first     parameter to be combined.
 * @param first_pos position of the first parameter in the final string
 * @param second    parameter to be combined.
 * @param sec_pos   position of the second parameter in the final string.
 * @param combined  above two into this parameter.
 * @param separator used to estethically join first and second parameter.
 */
// And she combines "FirstName" as "2" with "LastName" as "1" to "first_and_last_name" using "Space" separator
@Then("^she combines \"([^\"]*)\" as \"([^\"]*)\" with \"([^\"]*)\" as \"([^\"]*)\" to \"([^\"]*)\" using \"([^\"]*)\" separator$")
public void combinePresentFielsWithAnother(String first, String first_pos, String second, String sec_pos, String combined, String separator) {
    SelenideElement inputElement;
    SelenideElement selectElement;
    // Then she fills "FirstCombine" selector-input with "FirstName" value
    inputElement = mapper.getElementByAlias("FirstSource").shouldBe(visible);
    mapper.fillInput(inputElement, first);
    // And she selects "Combine" from "ActionSelect" selector-dropdown
    selectElement = mapper.getElementByAlias("ActionSelect").shouldBe(visible);
    mapper.selectOption(selectElement, "Combine");
    // And she selects "Space" from "SeparatorSelect" selector-dropdown
    selectElement = mapper.getElementByAlias("SeparatorSelect").shouldBe(visible);
    mapper.selectOption(selectElement, separator);
    // And clicks on the "Add Source" link
    mapper.getButton("Add Source").shouldBe(visible).click();
    // Then she fills "SecondCombine" selector-input with "LastName" value
    inputElement = mapper.getElementByAlias("SecondSource").shouldBe(visible);
    mapper.fillInputAndConfirm(inputElement, second);
    // And she fills "FirstCombinePosition" selector-input with "2" value
    inputElement = mapper.getElementByAlias("FirstSourcePosition").shouldBe(visible);
    mapper.fillInput(inputElement, first_pos);
    // And she fills "SecondCombinePosition" selector-input with "1" value
    inputElement = mapper.getElementByAlias("SecondSourcePosition").shouldBe(visible);
    mapper.fillInput(inputElement, sec_pos);
// Then she fills "TargetCombine" selector-input with "first_and_last_name" value
// inputElement = mapper.getElementByAlias("FirstTarget").shouldBe(visible);
// mapper.fillInputAndConfirm(inputElement, combined);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) Then(cucumber.api.java.en.Then)

Example 84 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class DataMapperSteps method separatePresentFielsIntoTwo.

// And she separates "FirstName" into "company" as "2" and "email" as "1" using "Comma" separator
@Then("^she separates \"([^\"]*)\" into \"([^\"]*)\" as \"([^\"]*)\" and \"([^\"]*)\" as \"([^\"]*)\" using \"([^\"]*)\" separator$")
public void separatePresentFielsIntoTwo(String input, String output1, String first_pos, String output2, String second_pos, String separator) {
    SelenideElement inputElement;
    SelenideElement selectElement;
    // inputElement = mapper.getElementByAlias("FirstSource").shouldBe(visible);
    // mapper.fillInput(inputElement, input);
    selectElement = mapper.getElementByAlias("ActionSelect").shouldBe(visible);
    mapper.selectOption(selectElement, "Separate");
    selectElement = mapper.getElementByAlias("SeparatorSelect").shouldBe(visible);
    mapper.selectOption(selectElement, separator);
    // NOTE: THIS STEP SHOULD HAVE BEEN DONE AUTOMATICALLY BY SELECTING "Separate" action
    mapper.getButton("Add Target").shouldBe(visible).click();
    inputElement = mapper.getElementByAlias("FirstTarget").shouldBe(visible);
    mapper.fillInputAndConfirm(inputElement, output1);
    inputElement = mapper.getElementByAlias("FirstTargetPosition").shouldBe(visible);
    mapper.fillInput(inputElement, first_pos);
    inputElement = mapper.getElementByAlias("SecondTarget").shouldBe(visible);
    mapper.fillInputAndConfirm(inputElement, output2);
    inputElement = mapper.getElementByAlias("SecondTargetPosition").shouldBe(visible);
    mapper.fillInput(inputElement, second_pos);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) Then(cucumber.api.java.en.Then)

Example 85 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class DataMapperSteps method selectFromDropDownByElement.

@When("^she selects \"([^\"]*)\" from \"([^\"]*)\" selector-dropdown$")
public void selectFromDropDownByElement(String option, String selectAlias) {
    log.info(option);
    SelenideElement selectElement = mapper.getElementByAlias(selectAlias).shouldBe(visible);
    mapper.selectOption(selectElement, option);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) When(cucumber.api.java.en.When)

Aggregations

SelenideElement (com.codeborne.selenide.SelenideElement)91 ElementsCollection (com.codeborne.selenide.ElementsCollection)16 Then (cucumber.api.java.en.Then)13 And (cucumber.api.java.en.And)8 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)6 ArrayList (java.util.ArrayList)5 When (cucumber.api.java.en.When)4 Test (org.junit.Test)4 QualityGate (org.sonar.wsclient.qualitygate.QualityGate)4 ProjectQualityGatePage (pageobjects.ProjectQualityGatePage)4 Given (cucumber.api.java.en.Given)2 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)2 DashboardPage (io.syndesis.qe.pages.dashboard.DashboardPage)2 StepComponent (io.syndesis.qe.pages.integrations.edit.steps.StepComponent)2 List (java.util.List)2 By (org.openqa.selenium.By)2 CollectionCondition.sizeGreaterThanOrEqual (com.codeborne.selenide.CollectionCondition.sizeGreaterThanOrEqual)1 Condition.visible (com.codeborne.selenide.Condition.visible)1 AbstractSelenideTest (com.evolveum.midpoint.testing.selenide.tests.AbstractSelenideTest)1 DataTable (cucumber.api.DataTable)1