Search in sources :

Example 11 with When

use of cucumber.api.java.en.When in project syndesis-qe by syndesisio.

the class DataMapperSteps method selectFromDropDownByElement.

@When("^she selects \"([^\"]*)\" from \"([^\"]*)\" selector-dropdown$")
public void selectFromDropDownByElement(String option, String selectAlias) {
    log.info(option);
    SelenideElement selectElement = mapper.getElementByAlias(selectAlias).shouldBe(visible);
    mapper.selectOption(selectElement, option);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) When(cucumber.api.java.en.When)

Example 12 with When

use of cucumber.api.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();
    Assertions.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) Condition(org.assertj.core.api.Condition) Assertions(org.assertj.core.api.Assertions) SupportPage(io.syndesis.qe.pages.SupportPage) IOException(java.io.IOException) ZipFile(java.util.zip.ZipFile) ZipEntry(java.util.zip.ZipEntry) When(cucumber.api.java.en.When) File(java.io.File) ZipFile(java.util.zip.ZipFile) File(java.io.File) When(cucumber.api.java.en.When)

Example 13 with When

use of cucumber.api.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("my-integration");
    File downloadedLogs = supportPage.downloadZipLogs();
    Assertions.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) Condition(org.assertj.core.api.Condition) Assertions(org.assertj.core.api.Assertions) SupportPage(io.syndesis.qe.pages.SupportPage) IOException(java.io.IOException) ZipFile(java.util.zip.ZipFile) ZipEntry(java.util.zip.ZipEntry) When(cucumber.api.java.en.When) File(java.io.File) ZipFile(java.util.zip.ZipFile) File(java.io.File) When(cucumber.api.java.en.When)

Example 14 with When

use of cucumber.api.java.en.When in project hippo by NHS-digital-website.

the class SiteSteps method iClickOn.

/**
 * Then I can click on link "foo bar"
 * When I click on "foo bar" button
 */
@When("^I (?:can )?click on(?: the| link)? \"([^\"]+)\"(?: link| button)?$")
public void iClickOn(String linkTitle) throws Throwable {
    WebElement element = sitePage.findElementWithTitle(linkTitle);
    assertThat("I can find element with title: " + linkTitle, element, is(notNullValue()));
    sitePage.clickOnElement(element);
}
Also used : WebElement(org.openqa.selenium.WebElement) When(cucumber.api.java.en.When)

Aggregations

When (cucumber.api.java.en.When)14 SelenideElement (com.codeborne.selenide.SelenideElement)3 Slf4j (lombok.extern.slf4j.Slf4j)3 Assertions (org.assertj.core.api.Assertions)3 ElementsCollection (com.codeborne.selenide.ElementsCollection)2 Integration (io.syndesis.common.model.integration.Integration)2 SupportPage (io.syndesis.qe.pages.SupportPage)2 File (java.io.File)2 IOException (java.io.IOException)2 Enumeration (java.util.Enumeration)2 ZipEntry (java.util.zip.ZipEntry)2 ZipFile (java.util.zip.ZipFile)2 Condition (org.assertj.core.api.Condition)2 Then (cucumber.api.java.en.Then)1 StepKind (io.syndesis.common.model.integration.StepKind)1 AtlasMapperGenerator (io.syndesis.qe.bdd.datamapper.AtlasMapperGenerator)1 StepDefinition (io.syndesis.qe.bdd.entities.StepDefinition)1 StepsStorage (io.syndesis.qe.bdd.storage.StepsStorage)1 IntegrationsDeploymentEndpoint (io.syndesis.qe.endpoints.IntegrationsDeploymentEndpoint)1 IntegrationsEndpoint (io.syndesis.qe.endpoints.IntegrationsEndpoint)1