use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class EditorSteps method checkAlertDialogDetails.
@Then("^check that alert dialog contains details \"([^\"]*)\"$")
public void checkAlertDialogDetails(String expectedDetailsText) {
SelenideElement alertElemet = editor.getDangerAlertElemet();
alertElemet.find(By.tagName("button")).click();
assertThat(alertElemet.find(By.tagName("pre")).getText()).isEqualTo(expectedDetailsText);
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class EditorSteps method checkAlertDialog.
@Then("^check that alert dialog contains text \"([^\"]*)\"$")
public void checkAlertDialog(String expectedText) {
ElementsCollection spans = editor.getDangerAlertElemet().findAll(By.tagName("span"));
assertThat(spans.stream().anyMatch(span -> span.getText().contains(expectedText))).isTrue().as("In the alert dialog is not expected text.");
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class ApiProviderSteps method verifyTheDisplayedURLMatchesHttpITodoIntegrationApi$.
@Then("^verify the displayed API Provider URL matches regex (.*)$")
public void verifyTheDisplayedURLMatchesHttpITodoIntegrationApi$(String regex) {
String apiUrl = new Details().getApiUrl();
assertThat(apiUrl).matches(regex);
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class ConnectionSteps method checkAllVisibleKebabMenus.
@Then("^check visibility of unveiled kebab menu of all connections, each of this menu consist of \"(\\w+)\", \"(\\w+)\" and \"(\\w+)\" actions$")
public void checkAllVisibleKebabMenus(String action1, String action2, String action3) {
List<String> actions = new ArrayList<>(Arrays.asList(action1, action2, action3));
for (SelenideElement connection : connectionsPage.getAllConnections()) {
KebabMenu kebabMenu = new KebabMenu(connection.$(ByUtils.dataTestId("button", "connection-card-kebab")).shouldBe(visible));
try {
kebabMenu.open();
TestUtils.sleepIgnoreInterrupt(1000);
for (String item : actions) {
if (!kebabMenu.isItemElementVisible(item)) {
kebabMenu.open();
assertTrue(kebabMenu.isItemElementVisible(item));
}
}
} catch (org.openqa.selenium.StaleElementReferenceException e) {
kebabMenu = new KebabMenu(connection.$(By.xpath(".//button")).shouldBe(visible));
kebabMenu.open();
for (String item : actions) {
kebabMenu.getItemElement(item).shouldBe(visible);
}
}
}
}
use of io.cucumber.java.en.Then in project syndesis-qe by syndesisio.
the class ConnectionSteps method testAuthenticationType.
@Then("^check that connection authentication type has (\\d+) options? and contains text \"([^\"]*)\"$")
public void testAuthenticationType(int expectedSize, String expectedString) {
ElementsCollection optionsFound = $(By.id("authenticationType")).shouldBe(visible).$$(By.tagName("option"));
assertThat(optionsFound).hasSize(expectedSize);
boolean expectedTextIsPresent = false;
for (SelenideElement e : optionsFound) {
expectedTextIsPresent = e.getText().contains(expectedString);
}
assertThat(expectedTextIsPresent).isTrue();
}
Aggregations