Search in sources :

Example 21 with Then

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

the class CommonSteps method saveBeforeTime.

/**
 * Save current time to the singleton class
 */
@Then("^save time before request for integration ([^\"]*)$")
public void saveBeforeTime(String integrationName) {
    calendarUtils.setBeforeRequest(Calendar.getInstance(), integrationName);
    log.info("Time before request was saved: " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calendarUtils.getLastBeforeRequest().getTime()));
    // due to border values
    TestUtils.sleepIgnoreInterrupt(3000);
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) Then(io.cucumber.java.en.Then)

Example 22 with Then

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

the class CommonSteps method fillFormViaTestID.

@Then("^fill in values by element data-testid")
public void fillFormViaTestID(DataTable data) {
    Form.waitForInputs(20);
    TestUtils.sleepIgnoreInterrupt(2000);
    Map<String, String> dataMap = new HashMap<>(data.asMap(String.class, String.class));
    dataMap.replaceAll((key, value) -> value == null ? "" : value);
    new Form(new SyndesisRootPage().getRootElement()).fillByTestId(dataMap);
}
Also used : SyndesisRootPage(io.syndesis.qe.pages.SyndesisRootPage) HashMap(java.util.HashMap) Form(io.syndesis.qe.fragments.common.form.Form) Then(io.cucumber.java.en.Then)

Example 23 with Then

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

the class CommonSteps method forceFillFormViaTestID.

@Then("^force fill in values by element data-testid$")
public void forceFillFormViaTestID(DataTable data) {
    Form.waitForInputs(20);
    TestUtils.sleepIgnoreInterrupt(2000);
    new Form(new SyndesisRootPage().getRootElement()).forceFillByTestId(data.asMap(String.class, String.class));
}
Also used : SyndesisRootPage(io.syndesis.qe.pages.SyndesisRootPage) Form(io.syndesis.qe.fragments.common.form.Form) Then(io.cucumber.java.en.Then)

Example 24 with Then

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

the class ManageCiCdPageSteps method checkCreationSameTag.

@Then("^check that tag (\\w+) cannot be created because another tag with same name exist$")
public void checkCreationSameTag(String tagName) {
    ciCdPage.clickOnAddNewTagButton();
    ModalDialogPage addDialog = new ModalDialogPage();
    assertThat(addDialog.getTitleText()).isEqualTo("Add Tag Name");
    addDialog.fillInputByDataTestid("cicd-edit-dialog-tag-name", tagName);
    addDialog.getElementByClassName("help-block").shouldBe(Condition.visible).shouldHave(Condition.text("That tag name is already in use."));
    addDialog.getButton("Save").shouldBe(Condition.disabled);
    new ModalDialogPage().getButton("Cancel").click();
}
Also used : ModalDialogPage(io.syndesis.qe.pages.ModalDialogPage) Then(io.cucumber.java.en.Then)

Example 25 with Then

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

the class ManageCiCdPageSteps method checkRenameToExistingTag.

@Then("^check that tag (\\w+) cannot be updated to (\\w+) because another tag with same name exist$")
public void checkRenameToExistingTag(String tagName, String newTagName) {
    ciCdPage.clickOnEditButton(tagName);
    ModalDialogPage editDialog = new ModalDialogPage();
    assertThat(editDialog.getTitleText()).isEqualTo("Edit Tag");
    editDialog.fillInputByDataTestid("cicd-edit-dialog-tag-name", tagName);
    editDialog.getElementByClassName("help-block").shouldBe(Condition.visible).shouldHave(Condition.text("That tag name is already in use."));
    editDialog.getButton("Save").shouldBe(Condition.disabled);
    new ModalDialogPage().getButton("Cancel").click();
}
Also used : ModalDialogPage(io.syndesis.qe.pages.ModalDialogPage) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)124 SelenideElement (com.codeborne.selenide.SelenideElement)20 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)16 List (java.util.List)13 HashMap (java.util.HashMap)10 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)9 Map (java.util.Map)9 ThingType (com.vaticle.typedb.core.concept.type.ThingType)8 DataTable (io.cucumber.datatable.DataTable)8 When (io.cucumber.java.en.When)8 Pod (io.fabric8.kubernetes.api.model.Pod)8 Quantity (io.fabric8.kubernetes.api.model.Quantity)8 ArrayList (java.util.ArrayList)8 Date (java.util.Date)8 TimeoutException (java.util.concurrent.TimeoutException)8 TestUtils (io.syndesis.qe.utils.TestUtils)7 HTTPResponse (io.syndesis.qe.utils.http.HTTPResponse)7 OpenShiftWaitUtils (io.syndesis.qe.wait.OpenShiftWaitUtils)7 Slf4j (lombok.extern.slf4j.Slf4j)7 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)7