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);
}
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.");
}
}
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));
}
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);
}
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();
}
Aggregations