Search in sources :

Example 11 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project midpoint by Evolveum.

the class AbstractSelenideTest method switchToInnerFrame.

protected void switchToInnerFrame() {
    SelenideElement element = $(byAttribute("class", "wicket-modal"));
    String modalWindowId = element.getAttribute("id");
    switchTo().innerFrame(modalWindowId);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement)

Example 12 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project midpoint by Evolveum.

the class ServiceTests method test004assignServiceToUserTest.

@Test(priority = 3, dependsOnMethods = { "test001createServiceTest" })
public void test004assignServiceToUserTest() {
    close();
    login();
    checkLoginIsPerformed();
    Map<String, String> usersMap = new HashMap<>();
    createUser(SERVICE_TEST_USER, usersMap);
    //search for the created user in users list
    searchForElement(SERVICE_TEST_USER);
    //click on the found user link
    $(By.linkText(SERVICE_TEST_USER)).shouldBe(visible).click();
    //assign End user role to user
    assignObjectToFocusObject(ASSIGN_ROLE_LINKTEXT, "ServiceType", SERVICE_NAME_VALUE + UPDATED_VALUE, null);
    //search for the user in users list
    searchForElement(SERVICE_TEST_USER);
    //click on the found user link
    $(By.linkText(SERVICE_TEST_USER)).shouldBe(visible).click();
    //check if assigned role is displayed on the Assignments tab
    openAssignmentsTab();
    $(byAttribute("about", "dropdownMenu")).click();
    $(By.linkText("Show all assignments")).shouldBe(visible).click();
    SelenideElement element = $(byAttribute("class", "wicket-modal"));
    element.find(By.linkText(SERVICE_DISPLAY_NAME_VALUE + UPDATED_VALUE)).shouldBe(visible);
    element.find(By.linkText(EndUserTests.ENDUSER_ROLE_NAME)).shouldBe(visible);
}
Also used : HashMap(java.util.HashMap) SelenideElement(com.codeborne.selenide.SelenideElement) Test(org.testng.annotations.Test) AbstractSelenideTest(com.evolveum.midpoint.testing.selenide.tests.AbstractSelenideTest)

Example 13 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class Form method fill.

public void fill(Map<String, String> data) {
    if (data.isEmpty()) {
        throw new IllegalArgumentException("can't find any connection details in connection");
    }
    ElementsCollection inputs = getRootElement().findAll(By.cssSelector("input"));
    List<String> keys = new ArrayList<String>();
    for (SelenideElement input : inputs) {
        String name = input.getAttribute("name");
        keys.add(name);
    }
    for (String key : data.keySet()) {
        if (keys.contains(key)) {
            log.info("fill connection Details detail {} ", key);
            SelenideElement input = getRootElement().$(String.format("input[name=\"%s\"", key)).shouldBe(visible);
            input.clear();
            input.sendKeys(data.get(key));
        } else {
            log.info("Input {} is not present on form!", key);
        }
    }
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection) SelenideElement(com.codeborne.selenide.SelenideElement) ArrayList(java.util.ArrayList)

Example 14 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class SyndesisPageObject method selectFromDropDown.

public void selectFromDropDown(String selectId, String option) {
    SelenideElement select = this.getElementById(selectId).shouldBe(visible);
    assertThat(select.getTagName(), is("select"));
    select.selectOption(option);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement)

Example 15 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project syndesis-qe by syndesisio.

the class TechExtensionsListComponent method chooseActionOnExtension.

public void chooseActionOnExtension(String name, String action) {
    SelenideElement extension = this.getExtensionItem(name);
    SelenideElement actionButton = extension.findAll(By.tagName("button")).filter(exactText(action)).first();
    actionButton.shouldBe(visible).click();
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement)

Aggregations

SelenideElement (com.codeborne.selenide.SelenideElement)91 ElementsCollection (com.codeborne.selenide.ElementsCollection)16 Then (cucumber.api.java.en.Then)13 And (cucumber.api.java.en.And)8 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)6 ArrayList (java.util.ArrayList)5 When (cucumber.api.java.en.When)4 Test (org.junit.Test)4 QualityGate (org.sonar.wsclient.qualitygate.QualityGate)4 ProjectQualityGatePage (pageobjects.ProjectQualityGatePage)4 Given (cucumber.api.java.en.Given)2 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)2 DashboardPage (io.syndesis.qe.pages.dashboard.DashboardPage)2 StepComponent (io.syndesis.qe.pages.integrations.edit.steps.StepComponent)2 List (java.util.List)2 By (org.openqa.selenium.By)2 CollectionCondition.sizeGreaterThanOrEqual (com.codeborne.selenide.CollectionCondition.sizeGreaterThanOrEqual)1 Condition.visible (com.codeborne.selenide.Condition.visible)1 AbstractSelenideTest (com.evolveum.midpoint.testing.selenide.tests.AbstractSelenideTest)1 DataTable (cucumber.api.DataTable)1