Search in sources :

Example 66 with SelenideElement

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

the class BasicFilterStepComponent method setPredicate.

public void setPredicate(String predicate) {
    log.info("setting basic filter step predicate to option number {}", predicate);
    SelenideElement predicateInput = this.getRootElement().find(Select.PREDICATE);
    this.selectOption(predicateInput, predicate);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement)

Example 67 with SelenideElement

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

the class DataMapperComponent method selectMapping.

/**
 * @param mappingName for instance "User.ScreenName"
 * @param containerElement start searching mapping fields from here
 */
public void selectMapping(String mappingName, SelenideElement containerElement) {
    // split and trim in one step:
    List<String> path = Arrays.asList(mappingName.trim().split("\\."));
    path.forEach(s -> {
        SelenideElement detailElement = containerElement.find(By.id(s)).shouldBe(visible);
        if (detailElement.find(Element.CHILDREN).exists()) {
        // if there're childrenFields display element is expanded already, click otherwise
        } else {
            detailElement.$(Element.LABEL).shouldBe(visible).click();
        }
    });
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement)

Example 68 with SelenideElement

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

the class DataMapperComponent method fieldsCount.

/**
 * Eventually returns count of found datamapper fields.
 *
 * @returns count of fields
 */
public Integer fieldsCount() {
    ElementsCollection dmColumns = this.dataMapperColumns();
    SelenideElement countElement = dmColumns.get(0).$(Element.LOADER_SELECTOR).shouldBe(visible);
    String countText = countElement.getText();
    // "77 fields" -> 77
    String[] found = countText.split(" ");
    if (found.length != 2) {
        throw new IllegalArgumentException(String.format("failed to get files number from %s", countText));
    }
    return Integer.parseInt(found[0]);
}
Also used : ElementsCollection(com.codeborne.selenide.ElementsCollection) SelenideElement(com.codeborne.selenide.SelenideElement)

Example 69 with SelenideElement

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

the class DataMapperComponent method closeBucket.

public void closeBucket(String bucketName) {
    SelenideElement bucket = getDataBucketElement(bucketName);
    if (bucket.$(Element.BUCKET_IS_IN_OPEN_STATE).isDisplayed()) {
        bucket.click();
        getRootElement().hover();
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement)

Example 70 with SelenideElement

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

the class DataMapperComponent method openBucket.

public void openBucket(String bucketName) {
    SelenideElement bucket = getDataBucketElement(bucketName);
    if (!bucket.$(Element.BUCKET_IS_IN_OPEN_STATE).isDisplayed()) {
        bucket.click();
        getRootElement().hover();
    }
}
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