Search in sources :

Example 6 with When

use of cucumber.api.java.en.When in project cucumber-jvm by cucumber.

the class SpringInjectionStepDefs method I_call_the_url.

@When("^I call the url \"([^\"]*)\"$")
public void I_call_the_url(String url) throws Throwable {
    MockMvc mock = MockMvcBuilders.webAppContextSetup(wac).build();
    callUrl = mock.perform(get(url));
}
Also used : MockMvc(org.springframework.test.web.servlet.MockMvc) When(cucumber.api.java.en.When)

Example 7 with When

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

the class IntegrationHandler method createIntegrationFromGivenStepsWithState.

@When("^create new integration with name: \"([^\"]*)\" and desiredState: \"([^\"]*)\"")
public void createIntegrationFromGivenStepsWithState(String integrationName, String desiredState) {
    processMapperSteps();
    Integration integration = new Integration.Builder().steps(steps.getSteps()).name(integrationName).description("Awkward integration.").build();
    log.info("Creating integration {}", integration.getName());
    String integrationId = integrationsEndpoint.create(integration).getId().get();
    log.info("Publish integration with ID: {}", integrationId);
    if (desiredState.contentEquals("Published")) {
        publishIntegration(integrationId);
    }
    // after the integration is created - the steps are cleaned for further use.
    log.debug("Flushing used steps");
    // TODO(tplevko): find some more elegant way to flush the steps before test start.
    steps.flushStepDefinitions();
}
Also used : Integration(io.syndesis.common.model.integration.Integration) When(cucumber.api.java.en.When)

Example 8 with When

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

the class CommonSteps method navigateTo.

@When("^\"([^\"]*)\" navigates? to the \"([^\"]*)\" page$")
public void navigateTo(String username, String title) {
    SelenideElement selenideElement = $(By.className("nav-pf-vertical")).shouldBe(visible);
    ElementsCollection allLinks = selenideElement.findAll(By.className("list-group-item-value"));
    allLinks.find(Condition.exactText(title)).shouldBe(visible).click();
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection) SelenideElement(com.codeborne.selenide.SelenideElement) When(cucumber.api.java.en.When)

Example 9 with When

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

the class SelectConnectionTypeSteps method selectConnectionType.

@When("^Camilla selects \"([^\"]*)\" connection type$")
public void selectConnectionType(String connectionName) {
    selectConnectionTypePage.selectConnectionType(connectionName);
    ConfigureConnection connectionWizardStep = null;
    switch(connectionName) {
        case "AMQ":
            connectionWizardStep = new ConfigureConnectionAmq();
            break;
        default:
            connectionWizardStep = new ConfigureConnection();
    }
    wizard.replaceStep(connectionWizardStep, 1);
}
Also used : ConfigureConnectionAmq(io.syndesis.qe.pages.connections.wizard.phases.configure.ConfigureConnectionAmq) ConfigureConnection(io.syndesis.qe.pages.connections.wizard.phases.configure.ConfigureConnection) When(cucumber.api.java.en.When)

Example 10 with When

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

the class ExtensionSteps method uploadFile.

@When("^Camilla upload extension \"([^\"]*)\"$")
public void uploadFile(String extensionName) throws Throwable {
    // TODO temporary solution
    String techExtensionFolderUrl = TestConfiguration.techExtensionUrl();
    String techExtensionUrl = techExtensionFolderUrl + extensionName + ".jar";
    Path techExtensionJar = Paths.get(techExtensionUrl).toAbsolutePath();
    $(By.cssSelector("input[type='file']")).shouldBe(visible).uploadFile(techExtensionJar.toFile());
}
Also used : Path(java.nio.file.Path) When(cucumber.api.java.en.When)

Aggregations

When (cucumber.api.java.en.When)14 SelenideElement (com.codeborne.selenide.SelenideElement)3 Slf4j (lombok.extern.slf4j.Slf4j)3 Assertions (org.assertj.core.api.Assertions)3 ElementsCollection (com.codeborne.selenide.ElementsCollection)2 Integration (io.syndesis.common.model.integration.Integration)2 SupportPage (io.syndesis.qe.pages.SupportPage)2 File (java.io.File)2 IOException (java.io.IOException)2 Enumeration (java.util.Enumeration)2 ZipEntry (java.util.zip.ZipEntry)2 ZipFile (java.util.zip.ZipFile)2 Condition (org.assertj.core.api.Condition)2 Then (cucumber.api.java.en.Then)1 StepKind (io.syndesis.common.model.integration.StepKind)1 AtlasMapperGenerator (io.syndesis.qe.bdd.datamapper.AtlasMapperGenerator)1 StepDefinition (io.syndesis.qe.bdd.entities.StepDefinition)1 StepsStorage (io.syndesis.qe.bdd.storage.StepsStorage)1 IntegrationsDeploymentEndpoint (io.syndesis.qe.endpoints.IntegrationsDeploymentEndpoint)1 IntegrationsEndpoint (io.syndesis.qe.endpoints.IntegrationsEndpoint)1