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