use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ImportIntegrationSteps method importIntegrationFromFile.
@When("^import integration from relative file path \"([^\"]*)\"$")
public void importIntegrationFromFile(String stringPathToFile) {
importIntegrationPage.importIntegration(new File(stringPathToFile));
// give jenkins more time so the integration shows up in the list
TestUtils.sleepIgnoreInterrupt(TestConfiguration.getJenkinsDelay());
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ApicurioSteps method setPathParameterTypeAsForPathParameter.
/**
* @param page can only have values "path" and "operations"
*/
@When("^set path parameter type as \"([^\"]*)\" for path parameter \"([^\"]*)\" on \"([^\"]*)\" page")
public void setPathParameterTypeAsForPathParameter(String as, String parameter, String page) {
SelenideElement root = ApicurioUtils.getPageElement(page);
ApicurioUtils.openPathTypes(parameter, root);
SelenideElement parameterElement = root.$(PathElements.PARAMETERS_SECTION).$$(PathElements.PATH_PARAMETERS_ROW).filter(text(parameter)).first();
ApicurioUtils.setDropDownValue(ApicurioUtils.Buttons.PROPERTY_TYPE_AS.getButtonId(), as, parameterElement);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ApicurioSteps method setTypeOfMediaType.
@When("^(set|check) type of \"([^\"]*)\" media type (?:to|is) \"([^\"]*)\" on property \"([^\"]*)\" for response \"([^\"]*)\"$")
public void setTypeOfMediaType(String check, String mediaType, String type, String property, String response) {
ApicurioUtils.ensureMediaTypeExistsForResponse(mediaType, response);
SelenideElement mediaRow = $$("media-type-row").find(text(mediaType));
SelenideElement typeElement = mediaRow.$(".type");
if (!typeElement.has(cssClass("selected"))) {
typeElement.click();
}
String buttonId = ApicurioUtils.getButtonId(property);
if ("set".equalsIgnoreCase(check)) {
ApicurioUtils.setDropDownValue(buttonId, type, $("schema-type-editor"));
} else {
String value = mediaRow.$(buttonId).getText();
assertThat(value).as("%s is %s but should be %s", property, value, type).isEqualTo(type);
}
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class GoogleCalendarSteps method fillInUpdateEventFormUsingCalendarIdSummaryAndDescription.
@When("^fill in update event form using calendar \"([^\"]*)\", old summary \"([^\"]*)\", summary \"([^\"]*)\" and description \"([^\"]*)\" for " + "user \"([^\"]*)\"$")
public void fillInUpdateEventFormUsingCalendarIdSummaryAndDescription(String calendarName, String oldSummary, String summary, String description, String ga) throws Throwable {
String aliasedCalendarName = gcu.getAliasedCalendarName(calendarName);
Calendar c = gcu.getPreviouslyCreatedCalendar(ga, aliasedCalendarName);
assertThat(c).as("Calendar %s is not amongst the created calendars.", aliasedCalendarName).isNotNull();
Event e = gcu.getEventBySummary(ga, c.getId(), oldSummary);
assertThat(e).as(String.format("Event %s is not present in calendar %s.", oldSummary, aliasedCalendarName)).isNotNull();
fillInUpdateEventForm(aliasedCalendarName, e.getId(), summary, description);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ODataSteps method insertEntityToODataService.
@When("^.*insert entity \"([^\"]*)\" into \"([^\"]*)\" collection on OData service$")
public void insertEntityToODataService(final String entity, final String collection) {
String requestBody = ODataUtils.readResourceFile(this.getClass().getClassLoader().getResource(entity));
Headers headers = Headers.of("Content-Type", "application/json");
HTTPResponse response = HTTPUtils.doPostRequest(ODataUtils.getV4OpenshiftRoute() + collection, requestBody, headers);
assertThat(response.getCode()).isEqualTo(201);
log.info("Entity from resource file " + entity + " succesfully inserted to sample OData service");
}
Aggregations