Search in sources :

Example 1 with KebabMenu

use of io.syndesis.qe.fragments.common.menu.KebabMenu in project syndesis-qe by syndesisio.

the class ConnectionSteps method checkAllVisibleKebabMenus.

@Then("^check visibility of unveiled kebab menu of all connections, each of this menu consist of \"(\\w+)\", \"(\\w+)\" and \"(\\w+)\" actions$")
public void checkAllVisibleKebabMenus(String action1, String action2, String action3) {
    List<String> actions = new ArrayList<>(Arrays.asList(action1, action2, action3));
    for (SelenideElement connection : connectionsPage.getAllConnections()) {
        KebabMenu kebabMenu = new KebabMenu(connection.$(ByUtils.dataTestId("button", "connection-card-kebab")).shouldBe(visible));
        try {
            kebabMenu.open();
            TestUtils.sleepIgnoreInterrupt(1000);
            for (String item : actions) {
                if (!kebabMenu.isItemElementVisible(item)) {
                    kebabMenu.open();
                    assertTrue(kebabMenu.isItemElementVisible(item));
                }
            }
        } catch (org.openqa.selenium.StaleElementReferenceException e) {
            kebabMenu = new KebabMenu(connection.$(By.xpath(".//button")).shouldBe(visible));
            kebabMenu.open();
            for (String item : actions) {
                kebabMenu.getItemElement(item).shouldBe(visible);
            }
        }
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ArrayList(java.util.ArrayList) KebabMenu(io.syndesis.qe.fragments.common.menu.KebabMenu) Then(io.cucumber.java.en.Then)

Example 2 with KebabMenu

use of io.syndesis.qe.fragments.common.menu.KebabMenu in project syndesis-qe by syndesisio.

the class ConnectionSteps method clickOnKebabMenuButtonOfConnection.

@When("^click on the \"([^\"]*)\" kebab menu button of \"([^\"]*)\"$")
public void clickOnKebabMenuButtonOfConnection(String button, String connectionName) throws Throwable {
    KebabMenu kebabMenu = new KebabMenu(connectionsPage.getConnection(connectionName).$(By.xpath(".//button")).shouldBe(visible));
    kebabMenu.open();
    kebabMenu.getItemElement(button).shouldBe(visible).click();
}
Also used : KebabMenu(io.syndesis.qe.fragments.common.menu.KebabMenu) When(io.cucumber.java.en.When)

Example 3 with KebabMenu

use of io.syndesis.qe.fragments.common.menu.KebabMenu in project syndesis-qe by syndesisio.

the class IntegrationsList method invokeActionOnItem.

public void invokeActionOnItem(String title, ListAction action) {
    KebabMenu kebabMenu = new KebabMenu(getItem(title).$(By.xpath(".//button")).should(exist));
    switch(action) {
        case VIEW:
            viewIntegration(title);
            break;
        case DELETE:
            kebabMenu.open();
            kebabMenu.getItemElement("Delete").shouldBe(visible).click();
            new ModalDialogPage().getButton("Delete").shouldBe(visible).click();
            break;
        default:
    }
}
Also used : ModalDialogPage(io.syndesis.qe.pages.ModalDialogPage) KebabMenu(io.syndesis.qe.fragments.common.menu.KebabMenu)

Example 4 with KebabMenu

use of io.syndesis.qe.fragments.common.menu.KebabMenu in project syndesis-qe by syndesisio.

the class ConnectionsList method invokeActionOnItem.

@Override
public void invokeActionOnItem(String title, ListAction action) {
    switch(action) {
        case DELETE:
            KebabMenu kebabMenu = new KebabMenu($(kebabMenu(title)).shouldBe(visible));
            kebabMenu.open();
            kebabMenu.getItemElement("Delete").shouldBe(visible).click();
            TestUtils.sleepForJenkinsDelayIfHigher(3);
            new ModalDialogPage().getButton("Delete").shouldBe(visible).click();
            break;
        case CLICK:
            getItem(title).find(Element.CONNECTION_CARD_TITLE).shouldBe(visible).click();
            break;
        default:
            super.invokeActionOnItem(title, action);
    }
}
Also used : ModalDialogPage(io.syndesis.qe.pages.ModalDialogPage) KebabMenu(io.syndesis.qe.fragments.common.menu.KebabMenu)

Aggregations

KebabMenu (io.syndesis.qe.fragments.common.menu.KebabMenu)4 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)2 SelenideElement (com.codeborne.selenide.SelenideElement)1 Then (io.cucumber.java.en.Then)1 When (io.cucumber.java.en.When)1 ArrayList (java.util.ArrayList)1