Search in sources :

Example 41 with SelenideElement

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

the class IntegrationSteps method setJmsRequestData.

@And("^sets jms request inputs source data$")
public void setJmsRequestData(DataTable sourceMappingData) {
    for (Map<String, String> source : sourceMappingData.asMaps(String.class, String.class)) {
        for (String field : source.keySet()) {
            SelenideElement element = editPage.getJmsSubscribeComponent().checkAndGetFieldTypeById(field);
            assertThat(element, notNullValue());
            editPage.getJmsSubscribeComponent().setElementValue(source.get(field), element);
        }
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) And(cucumber.api.java.en.And)

Example 42 with SelenideElement

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

the class DragAndDropFile method dragAndDropFile.

/**
 * Parameter file will be dragged to dragTarget, then method will wait for waitForElement to be visible
 * For now it only works if your drag and drop target is inside ModalDialogPage.
 *
 * @param file
 * @param dragTarget
 * @param waitForElement
 */
public static void dragAndDropFile(File file, SelenideElement dragTarget, By waitForElement) {
    createInputFile();
    // find newly created file input element so we can put our file there
    SelenideElement fileInput = $("#selenideUpload");
    fileInput.uploadFile(file);
    dispatchFileDragAndDropEvent("dragenter", "document", fileInput);
    dispatchFileDragAndDropEvent("dragover", "document", fileInput);
    dispatchFileDragAndDropEvent("drop", dragTarget, fileInput);
    // wait until file appears on the page
    $(waitForElement).waitUntil(appears, 5000);
    // remove fake input file element
    executeJavaScript("arguments[0].parentNode.removeChild(arguments[0]);", fileInput);
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement)

Example 43 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project sonarqube by SonarSource.

the class ProjectQualityGatePageTest method should_display_custom.

@Test
public void should_display_custom() {
    QualityGate customQualityGate = createCustomQualityGate("should_display_custom");
    associateWithQualityGate(customQualityGate);
    ProjectQualityGatePage page = openPage();
    SelenideElement selectedQualityGate = page.getSelectedQualityGate();
    selectedQualityGate.shouldNot(Condition.hasText("Default"));
    selectedQualityGate.should(Condition.hasText(customQualityGate.name()));
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ProjectQualityGatePage(pageobjects.ProjectQualityGatePage) QualityGate(org.sonar.wsclient.qualitygate.QualityGate) Test(org.junit.Test)

Example 44 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project sonarqube by SonarSource.

the class ProjectQualityGatePageTest method should_display_default.

@Test
public void should_display_default() {
    QualityGate customQualityGate = createCustomQualityGate("should_display_default");
    qualityGateClient().setDefault(customQualityGate.id());
    ProjectQualityGatePage page = openPage();
    SelenideElement selectedQualityGate = page.getSelectedQualityGate();
    selectedQualityGate.should(Condition.hasText("Default"));
    selectedQualityGate.should(Condition.hasText(customQualityGate.name()));
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) ProjectQualityGatePage(pageobjects.ProjectQualityGatePage) QualityGate(org.sonar.wsclient.qualitygate.QualityGate) Test(org.junit.Test)

Example 45 with SelenideElement

use of com.codeborne.selenide.SelenideElement in project sonarqube by SonarSource.

the class ProjectKeyPage method tryFineGrainedUpdate.

public ProjectKeyPage tryFineGrainedUpdate(String key, String newKey) {
    SelenideElement form = $(".js-fine-grained-update[data-key=\"" + key + "\"]");
    form.shouldBe(visible);
    form.$("input").val(newKey);
    form.$("button").click();
    $("#update-key-confirm").click();
    return this;
}
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