use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ServiceNowSteps method fillInAndModifyValuesByElementID.
@When("fill in and modify values by element ID")
public void fillInAndModifyValuesByElementID(DataTable data) {
Map<String, String> map = new HashMap<>();
data.asMap(String.class, String.class).forEach((k, v) -> map.put(k.toString(), snUtils.modifySNNumber(v.toString())));
new Form(new SyndesisRootPage().getRootElement()).fillByTestId(map);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class SupportPageSteps method downloadAllLogs.
@When("^.*downloads? diagnostics for all integrations$")
public void downloadAllLogs() throws InterruptedException, IOException {
supportPage.selectAllIntegrationDownload();
File downloadedLogs = supportPage.downloadZipLogs();
assertThat(downloadedLogs).exists().isFile().has(new Condition<>(f -> f.length() > 0, "File size should be greater than 0"));
checkDownloadedFileContent(downloadedLogs);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class SupportPageSteps method downloadSpecificLogs.
@When("^.*downloads? diagnostics for \"([^\"]*)\" integration$")
public void downloadSpecificLogs(String integrationName) throws InterruptedException, IOException {
supportPage.selectSpecificIntegrationDownload(integrationName);
File downloadedLogs = supportPage.downloadZipLogs();
assertThat(downloadedLogs).exists().isFile().has(new Condition<>(f -> f.length() > 0, "File size should be greater than 0"));
checkDownloadedFileContent(downloadedLogs);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class GoogleCalendarSteps method fillInGetSpecificEventFormUsingCalendarAndEventSummary.
@When("^fill in get specific event form using account \"([^\"]*)\", calendar \"([^\"]*)\" and event \"([^\"]*)\"$")
public void fillInGetSpecificEventFormUsingCalendarAndEventSummary(String account, String calendarSummary, String eventSummary) throws Throwable {
String aliasedCalendarSummary = gcu.getAliasedCalendarName(calendarSummary);
GetSpecificEvent getSpecificEvent = new GetSpecificEvent();
String calendarId = gcu.getPreviouslyCreatedCalendar(account, aliasedCalendarSummary).getId();
String eventId = gcu.getEventBySummary(account, calendarId, eventSummary).getId();
getSpecificEvent.fillEventInput(aliasedCalendarSummary, eventId);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class GoogleCalendarSteps method fillInAliasedCalendarValues.
@When("^fill in aliased calendar values by data-testid$")
public void fillInAliasedCalendarValues(DataTable data) {
// we need to find the calendar name in the table and alias it before passing on to fillForm
// we also need to create a copy of the raw DataTable lists, because the returned lists are unmodifiable
List<List<String>> newCells = new ArrayList<>();
for (List<String> row : data.cells()) {
List<String> newRow = new ArrayList<>(row);
newCells.add(row.stream().map(s -> s == null ? "" : s).collect(Collectors.toList()));
if ("calendarid".equals(newRow.get(0))) {
newRow.set(1, gcu.getAliasedCalendarName(newRow.get(1)));
}
}
DataTable newData = DatatableUtils.create(newCells);
new CommonSteps().fillFormViaTestID(newData);
}
Aggregations