Search in sources :

Example 81 with Then

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

the class ApicurioSteps method checkFieldsExistence.

@Then("^check that apicurio connection authentication type contains only fields:$")
public void checkFieldsExistence(DataTable fields) {
    List<List<String>> dataRows = fields.cells();
    List<String> first = new ArrayList<String>();
    for (List<String> row : dataRows) {
        first.add(row.get(0));
    }
    new Form($(Elements.CARD_PF)).checkByTestId(first);
}
Also used : Form(io.syndesis.qe.fragments.common.form.Form) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Then(io.cucumber.java.en.Then)

Example 82 with Then

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

the class ApicurioSteps method verifySelectedSecurity.

@ExcludeFromSelectorReports
@Then("^check that api connector authentication section contains security type \"([^\"]*)\"$")
public void verifySelectedSecurity(String securityType) {
    SelenideElement securityForm = $(SpecifySecurity.Element.SECURITY_FORM).shouldBe(visible);
    switch(securityType) {
        case "OAuth 2.0":
            securityForm.$(SpecifySecurity.SecurityType.OAUTH_2).shouldBe(visible);
            assertThat(securityForm.text()).containsIgnoringCase("OAuth 2.0 ");
            break;
        case "HTTP Basic Authentication":
            securityForm.$(SpecifySecurity.SecurityType.HTTP_BASIC_AUTHENTICATION).shouldBe(visible);
            assertThat(securityForm.text()).containsIgnoringCase("HTTP Basic Authentication");
            break;
        case "API Key":
            securityForm.$(SpecifySecurity.SecurityType.API_KEY).shouldBe(visible);
            assertThat(securityForm.text()).containsIgnoringCase("API Key");
            break;
        case "No Security":
            securityForm.$(SpecifySecurity.SecurityType.NO_SECURITY).shouldBe(visible);
            assertThat(securityForm.text()).containsIgnoringCase("No Security");
            break;
        default:
            fail("The Auth type < " + securityType + "> is not implemented by the test.");
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ExcludeFromSelectorReports(io.syndesis.qe.report.selector.ExcludeFromSelectorReports) Then(io.cucumber.java.en.Then)

Example 83 with Then

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

the class ApicurioSteps method verifyErrors.

@ExcludeFromSelectorReports
@Then("^check that apicurio shows (\\d+) errors?$")
public void verifyErrors(int expectedCount) {
    SelenideElement operations = $(Elements.ERRORS).shouldBe(visible);
    assertThat(operations).isNotNull();
    assertThat(operations.getText()).containsIgnoringCase(Integer.toString(expectedCount));
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ExcludeFromSelectorReports(io.syndesis.qe.report.selector.ExcludeFromSelectorReports) Then(io.cucumber.java.en.Then)

Example 84 with Then

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

the class DashboardSteps method expectConnectionTitlePresent.

@Then("^check visibility of \"([^\"]*)\" 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(io.cucumber.java.en.Then)

Example 85 with Then

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

the class IntegrationSteps method waitForIntegrationStartingState.

/*
     * State != starting state
     * Starting state is state during publication of integration e.g.
     * "Assembling ( 1 / 4 )", "Building ( 2 / 4 )" ,"Deploying ( 3 / 4 )", "Starting ( 4 / 4 )"
     */
@Then("^wait until integration \"([^\"]*)\" starting status gets into \"([^\"]*)\" state$")
public void waitForIntegrationStartingState(String integrationName, String integrationStatus) {
    commonSteps.navigateTo("Integrations");
    SelenideElement integration = integrations.getIntegration(integrationName);
    TestUtils.sleepForJenkinsDelayIfHigher(10);
    assertThat(TestUtils.waitForEvent(status -> status.equals(integrationStatus), () -> integrations.getIntegrationItemStartingStatus(integration), TimeUnit.MINUTES, 10, TimeUnit.MILLISECONDS, 30)).isTrue();
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) 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