Search in sources :

Example 76 with When

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);
}
Also used : SyndesisRootPage(io.syndesis.qe.pages.SyndesisRootPage) HashMap(java.util.HashMap) Form(io.syndesis.qe.fragments.common.form.Form) When(io.cucumber.java.en.When)

Example 77 with When

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);
}
Also used : Slf4j(lombok.extern.slf4j.Slf4j) Enumeration(java.util.Enumeration) When(io.cucumber.java.en.When) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Condition(org.assertj.core.api.Condition) SupportPage(io.syndesis.qe.pages.SupportPage) IOException(java.io.IOException) ZipFile(java.util.zip.ZipFile) ZipEntry(java.util.zip.ZipEntry) File(java.io.File) ZipFile(java.util.zip.ZipFile) File(java.io.File) When(io.cucumber.java.en.When)

Example 78 with When

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);
}
Also used : Slf4j(lombok.extern.slf4j.Slf4j) Enumeration(java.util.Enumeration) When(io.cucumber.java.en.When) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Condition(org.assertj.core.api.Condition) SupportPage(io.syndesis.qe.pages.SupportPage) IOException(java.io.IOException) ZipFile(java.util.zip.ZipFile) ZipEntry(java.util.zip.ZipEntry) File(java.io.File) ZipFile(java.util.zip.ZipFile) File(java.io.File) When(io.cucumber.java.en.When)

Example 79 with When

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);
}
Also used : GetSpecificEvent(io.syndesis.qe.pages.integrations.editor.add.connection.actions.google.GetSpecificEvent) When(io.cucumber.java.en.When)

Example 80 with When

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);
}
Also used : DataTable(io.cucumber.datatable.DataTable) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CommonSteps(io.syndesis.qe.steps.CommonSteps) When(io.cucumber.java.en.When)

Aggregations

When (io.cucumber.java.en.When)111 SelenideElement (com.codeborne.selenide.SelenideElement)23 Map (java.util.Map)10 File (java.io.File)8 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)7 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)7 Attribute (com.vaticle.typedb.core.concept.thing.Attribute)6 Account (io.syndesis.qe.account.Account)6 Form (io.syndesis.qe.fragments.common.form.Form)6 Syndesis (io.syndesis.qe.resource.impl.Syndesis)6 TimeoutException (java.util.concurrent.TimeoutException)6 RoleType (com.vaticle.typedb.core.concept.type.RoleType)5 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 Slf4j (lombok.extern.slf4j.Slf4j)5 ElementsCollection (com.codeborne.selenide.ElementsCollection)4 DataTable (io.cucumber.datatable.DataTable)4 IntegrationsEndpoint (io.syndesis.qe.endpoint.IntegrationsEndpoint)4 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)4 List (java.util.List)4