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));
}
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));
}
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();
}
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();
}
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());
}
Aggregations