Search in sources :

Example 16 with Then

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

the class FhirValidationSteps method validateThatLastInsertPatientNameHasBeenChangedToInFHIR.

@Then("validate that last inserted patients name has been changed to {string} in FHIR")
public void validateThatLastInsertPatientNameHasBeenChangedToInFHIR(String newName) {
    MyPatientSpecification newPs = splitName(newName);
    newPs.setId(fhirUtils.getLastPatientId());
    assertThat(fhirUtils.isPatientInFhir(newPs)).isTrue();
}
Also used : MyPatientSpecification(io.syndesis.qe.util.fhir.MyPatientSpecification) Then(io.cucumber.java.en.Then)

Example 17 with Then

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

the class HTTPValidationSteps method verifyThatAfterSecondsWasCalls.

@Then("^verify that after (\\d+) seconds there (?:were|was) (\\d+) calls?$")
public void verifyThatAfterSecondsWasCalls(int seconds, int calls) {
    clear();
    TestUtils.sleepIgnoreInterrupt((long) seconds * 1000);
    HTTPResponse r = HTTPUtils.doGetRequest("http://localhost:28080/events");
    Map<Long, String> events = new Gson().fromJson(r.getBody(), Map.class);
    assertThat(events).size().isEqualTo(calls);
}
Also used : HTTPResponse(io.syndesis.qe.utils.http.HTTPResponse) Gson(com.google.gson.Gson) Then(io.cucumber.java.en.Then)

Example 18 with Then

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

the class BoxValidationSteps method verifyFileWithContentIsPresent.

@Then("verify that file {string} with content {string} is present in Box")
public void verifyFileWithContentIsPresent(String filename, String content) {
    BoxFile f = boxUtils.getFile(filename);
    Assertions.assertThat(f).isNotNull();
    final String localFileName = "/tmp/" + UUID.randomUUID().toString();
    try (FileOutputStream fos = new FileOutputStream(localFileName)) {
        f.download(fos);
        Assertions.assertThat(FileUtils.readFileToString(new File(localFileName), "UTF-8").trim()).isEqualTo(content);
    } catch (IOException ex) {
        fail("Unable to process file from Box: ", ex);
    }
}
Also used : BoxFile(com.box.sdk.BoxFile) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) File(java.io.File) BoxFile(com.box.sdk.BoxFile) Then(io.cucumber.java.en.Then)

Example 19 with Then

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

the class UpgradeSteps method checkPullSecret.

@Then("check that pull secret is linked in the service accounts")
public void checkPullSecret() {
    boolean found = false;
    // If it is present in the server, it was linked to all others needed
    for (LocalObjectReference imagePullSecret : OpenShiftUtils.getInstance().getServiceAccount("syndesis-server").getImagePullSecrets()) {
        if (imagePullSecret.getName().equals(TestConfiguration.syndesisPullSecretName())) {
            found = true;
            break;
        }
    }
    assertThat(found).as("The pull secret should be linked to service account, but wasn't").isTrue();
}
Also used : LocalObjectReference(io.fabric8.kubernetes.api.model.LocalObjectReference) Then(io.cucumber.java.en.Then)

Example 20 with Then

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

the class CommonSteps method successNotificationIsPresentWithError.

@Then("^check visibility of \"([^\"]*)\" in alert-(\\w+) notification$")
public void successNotificationIsPresentWithError(String textMessage, String type) {
    TestUtils.waitFor(() -> $$(Alert.getALERTS().get(type).getBy()).filterBy(Condition.matchesText(sanitizeSpecialCharacter(textMessage))).size() == 1, 2, 20, "Success notification not found!");
    ElementsCollection successList = getAllAlerts(textMessage, type);
    assertThat(successList).hasSize(1);
    log.info("Text message {} was found.", textMessage);
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection) 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