Search in sources :

Example 66 with When

use of cucumber.api.java.en.When in project hippo by NHS-digital-website.

the class CmsSteps method whenICreateANewPublicationWithTaxonomy.

@When("^I create a publication with taxonomy$")
public void whenICreateANewPublicationWithTaxonomy() throws Throwable {
    final Publication publication = TestDataFactory.createBareMinimumPublication().withTaxonomy(Taxonomy.createNew("Conditions", "Accidents and injuries", "Falls")).build();
    testDataRepo.setPublication(publication);
    assertThat("New publication created.", contentPage.newPublication(publication), is(true));
}
Also used : Publication(uk.nhs.digital.ps.test.acceptance.models.Publication) When(cucumber.api.java.en.When)

Example 67 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 68 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 69 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 70 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)148 TestUtils.nullAsString (alien4cloud.it.utils.TestUtils.nullAsString)12 Application (alien4cloud.model.application.Application)10 FlowPayload (org.openkilda.messaging.payload.flow.FlowPayload)6 StandardEvaluationContext (org.springframework.expression.spel.support.StandardEvaluationContext)6 ComponentSearchRequest (alien4cloud.rest.component.ComponentSearchRequest)5 FilteredSearchRequest (alien4cloud.rest.model.FilteredSearchRequest)5 TopologyDTO (alien4cloud.topology.TopologyDTO)4 Path (java.nio.file.Path)4 List (java.util.List)4 UiApplicationDriver (org.activityinfo.test.driver.UiApplicationDriver)4 PivotTableEditor (org.activityinfo.test.pageobject.web.reports.PivotTableEditor)4 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)4 WebElement (org.openqa.selenium.WebElement)4 MvcResult (org.springframework.test.web.servlet.MvcResult)4 NotFoundException (alien4cloud.exception.NotFoundException)3 Context (alien4cloud.it.Context)3 MetaPropConfiguration (alien4cloud.model.common.MetaPropConfiguration)3 DeployApplicationRequest (alien4cloud.rest.application.model.DeployApplicationRequest)3 UpdateDeploymentTopologyRequest (alien4cloud.rest.application.model.UpdateDeploymentTopologyRequest)3