Search in sources :

Example 71 with When

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

the class IntermediateSteps method addSplitStep.

@When("add a split step")
public void addSplitStep() {
    final DataShape in = super.getSteps().getLastStepDefinition().getStep().getAction().get().getInputDataShape().get();
    final DataShape out = super.getSteps().getLastStepDefinition().getStep().getAction().get().getOutputDataShape().get();
    StepDescriptor sd = stepDescriptorEndpoint.getStepDescriptor("split", in, out);
    super.addProperty(StepProperty.KIND, StepKind.split);
    super.addProperty(StepProperty.ACTION, super.generateStepAction(super.getSteps().getLastStepDefinition().getStep().getAction().get(), sd));
    super.addProperty(StepProperty.STEP_NAME, "Split");
    super.createStep();
}
Also used : StepDescriptor(io.syndesis.common.model.action.StepDescriptor) DataShape(io.syndesis.common.model.DataShape) When(io.cucumber.java.en.When)

Example 72 with When

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

the class IntermediateSteps method addAggregateStep.

@When("add an aggregate step")
public void addAggregateStep() {
    Step previousStepWithDatashapes = null;
    for (int i = super.getSteps().getSteps().size() - 1; i >= 0; i--) {
        Step s = super.getSteps().getSteps().get(i);
        if (s.getAction().isPresent() && s.getAction().get().getInputDataShape().isPresent() && s.getAction().get().getOutputDataShape().isPresent()) {
            previousStepWithDatashapes = super.getSteps().getSteps().get(i);
            break;
        }
    }
    if (previousStepWithDatashapes == null) {
        fail("Unable to find previous step with both datashapes set");
    }
    StepDescriptor sd = stepDescriptorEndpoint.getStepDescriptor("aggregate", previousStepWithDatashapes.getAction().get().getInputDataShape().get(), previousStepWithDatashapes.getAction().get().getOutputDataShape().get());
    super.addProperty(StepProperty.KIND, StepKind.aggregate);
    super.addProperty(StepProperty.ACTION, super.generateStepAction(previousStepWithDatashapes.getAction().get(), sd));
    super.addProperty(StepProperty.STEP_NAME, "Aggregate");
    super.createStep();
}
Also used : StepDescriptor(io.syndesis.common.model.action.StepDescriptor) Step(io.syndesis.common.model.integration.Step) ExtensionsEndpoint(io.syndesis.qe.endpoint.ExtensionsEndpoint) StepDescriptorEndpoint(io.syndesis.qe.endpoint.StepDescriptorEndpoint) When(io.cucumber.java.en.When)

Example 73 with When

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

the class IntegrationStateHandler method rebuildIntegration.

@When("rebuild integration with name {string}")
public void rebuildIntegration(String name) {
    Optional<String> integrationId = integrationsEndpoint.getIntegrationId(name);
    if (!integrationId.isPresent()) {
        InfraFail.fail("Unable to find ID for flow " + name);
    }
    final int currentNo = OpenShiftUtils.extractPodSequenceNr(OpenShiftUtils.getIntegrationPod(name, p -> p.getMetadata().getName().endsWith("-build")));
    integrationsEndpoint.activateIntegration(integrationId.get());
    try {
        OpenShiftWaitUtils.waitFor(() -> OpenShiftUtils.integrationPodExists(name, p -> p.getMetadata().getName().endsWith("build"), p -> OpenShiftUtils.extractPodSequenceNr(p) > currentNo), 10000L, 60000L);
    } catch (TimeoutException | InterruptedException e) {
        InfraFail.fail("Unable to find new build pod for integration " + name + "after 60 seconds");
    }
}
Also used : Slf4j(lombok.extern.slf4j.Slf4j) InfraFail(io.syndesis.qe.test.InfraFail) IntegrationsEndpoint(io.syndesis.qe.endpoint.IntegrationsEndpoint) When(io.cucumber.java.en.When) Autowired(org.springframework.beans.factory.annotation.Autowired) Optional(java.util.Optional) TimeoutException(java.util.concurrent.TimeoutException) OpenShiftUtils(io.syndesis.qe.utils.OpenShiftUtils) OpenShiftWaitUtils(io.syndesis.qe.wait.OpenShiftWaitUtils) IntegrationsEndpoint(io.syndesis.qe.endpoint.IntegrationsEndpoint) TimeoutException(java.util.concurrent.TimeoutException) When(io.cucumber.java.en.When)

Example 74 with When

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

the class GMailSteps method sendEmailToCreds.

@When("^.*send an e-mail to credentials \"([^\"]*)\" with subject \"([^\"]*)\"$")
public void sendEmailToCreds(String credentials, String subject) {
    Account account = AccountsDirectory.getInstance().get(credentials);
    sendEmail(account.getProperty("username"), subject);
}
Also used : Account(io.syndesis.qe.account.Account) GoogleAccount(io.syndesis.qe.utils.google.GoogleAccount) When(io.cucumber.java.en.When)

Example 75 with When

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

the class JiraSteps method commentIssue.

@When("comment previously created jira issue with text \"([^\"]*)\"")
public void commentIssue(String text) {
    Issue issue = jiraRestClient.getIssueClient().getIssue(sharedIssueKey).claim();
    jiraRestClient.getIssueClient().addComment(issue.getCommentsUri(), Comment.valueOf(text)).claim();
}
Also used : BasicIssue(com.atlassian.jira.rest.client.api.domain.BasicIssue) Issue(com.atlassian.jira.rest.client.api.domain.Issue) When(io.cucumber.java.en.When)

Aggregations

When (io.cucumber.java.en.When)111 SelenideElement (com.codeborne.selenide.SelenideElement)23 Map (java.util.Map)10 File (java.io.File)8 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)7 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)7 Attribute (com.vaticle.typedb.core.concept.thing.Attribute)6 Account (io.syndesis.qe.account.Account)6 Form (io.syndesis.qe.fragments.common.form.Form)6 Syndesis (io.syndesis.qe.resource.impl.Syndesis)6 TimeoutException (java.util.concurrent.TimeoutException)6 RoleType (com.vaticle.typedb.core.concept.type.RoleType)5 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 Slf4j (lombok.extern.slf4j.Slf4j)5 ElementsCollection (com.codeborne.selenide.ElementsCollection)4 DataTable (io.cucumber.datatable.DataTable)4 IntegrationsEndpoint (io.syndesis.qe.endpoint.IntegrationsEndpoint)4 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)4 List (java.util.List)4