Search in sources :

Example 41 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class SettingsSteps method clickButtonOfItem.

@When("^remove information about OAuth \"([^\"]*)\"$")
public void clickButtonOfItem(String itemTitle) {
    settingsPage.openSettings(itemTitle);
    settingsPage.clickButton(itemTitle, "Remove");
    // confirm
    ModalDialogPage modalDialogPage = new ModalDialogPage();
    assertThat(modalDialogPage.getTitleText()).contains(String.format("Are you sure you want to remove the OAuth credentials for '%s'?", itemTitle));
    modalDialogPage.getButton("Remove").shouldBe(enabled).click();
    settingsPage.closeCurrentlyExpandedSettings();
}
Also used : ModalDialogPage(io.syndesis.qe.pages.ModalDialogPage) When(io.cucumber.java.en.When)

Example 42 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class ConditionalFlowSteps method clickOnConditionIcon.

// data:
// |position   |ACTION   |
// |1          |UP       |
// |0          |DOWN     |
// |1          |DELETE   |
@When("^click on the condition icon$")
public void clickOnConditionIcon(DataTable data) {
    for (List<String> row : data.cells()) {
        SelenideElement selectedCondition = $(EditFlowStepElements.getConditionIconsOnPosition(row.get(0))).shouldBe(visible);
        By iconSelector;
        switch(row.get(1)) {
            case "UP":
                iconSelector = EditFlowStepElements.ICON_UP;
                break;
            case "DOWN":
                iconSelector = EditFlowStepElements.ICON_DOWN;
                break;
            case "DELETE":
                iconSelector = EditFlowStepElements.ICON_DELETE;
                break;
            default:
                throw new IllegalArgumentException("Incorrect data table value on position 1");
        }
        selectedCondition.$(iconSelector).shouldBe(visible).click();
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) By(org.openqa.selenium.By) When(io.cucumber.java.en.When)

Example 43 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class JiraSteps method fillIssueKey.

@When("fill in issuekey for previously created issue")
public void fillIssueKey() {
    Form.waitForInputs(20);
    new Form(new SyndesisRootPage().getRootElement()).fillByTestId(TestUtils.map("issuekey", sharedIssueKey));
}
Also used : SyndesisRootPage(io.syndesis.qe.pages.SyndesisRootPage) Form(io.syndesis.qe.fragments.common.form.Form) When(io.cucumber.java.en.When)

Example 44 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class ServiceNowSteps method mapModifiedNumberToIncidentNumber.

/**
 * Number is modified according to browser name. (due to parallelization)
 */
@When("define modified service now number {string} and map it to {string}")
public void mapModifiedNumberToIncidentNumber(String incidentNumber, String mapTo) {
    String modifiedNumber = snUtils.modifySNNumber(incidentNumber);
    DataMapper mapper = new DataMapper();
    mapper.addConstant(modifiedNumber, "String");
    mapper.openDataMapperCollectionElement();
    mapper.doCreateMapping(modifiedNumber, mapTo);
}
Also used : DataMapper(io.syndesis.qe.pages.integrations.editor.add.steps.DataMapper) When(io.cucumber.java.en.When)

Example 45 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class CommonSteps method clickOnButton.

@When("^click? on the \"([^\"]*)\" button.*$")
public void clickOnButton(String buttonTitle) {
    UIUtils.ensureUILoaded();
    if ("Done".equals(buttonTitle)) {
        // this is hack to replace Done with Next if not present
        try {
            syndesisRootPage.getRootElement().shouldBe(visible).findAll(By.tagName("button")).filter(matchText("(\\s*)" + buttonTitle + "(\\s*)")).first().waitUntil(visible, 10 * 1000);
        } catch (Throwable t) {
            buttonTitle = "Next";
        }
    }
    SelenideElement button = syndesisRootPage.getButton(buttonTitle);
    log.info(button.toString());
    button.shouldBe(visible, enabled).shouldNotHave(attribute("disabled")).click();
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) When(io.cucumber.java.en.When)

Aggregations

When (io.cucumber.java.en.When)111 SelenideElement (com.codeborne.selenide.SelenideElement)23 Map (java.util.Map)10 File (java.io.File)8 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)7 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)7 Attribute (com.vaticle.typedb.core.concept.thing.Attribute)6 Account (io.syndesis.qe.account.Account)6 Form (io.syndesis.qe.fragments.common.form.Form)6 Syndesis (io.syndesis.qe.resource.impl.Syndesis)6 TimeoutException (java.util.concurrent.TimeoutException)6 RoleType (com.vaticle.typedb.core.concept.type.RoleType)5 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 Slf4j (lombok.extern.slf4j.Slf4j)5 ElementsCollection (com.codeborne.selenide.ElementsCollection)4 DataTable (io.cucumber.datatable.DataTable)4 IntegrationsEndpoint (io.syndesis.qe.endpoint.IntegrationsEndpoint)4 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)4 List (java.util.List)4