Skip to content

Commit

Permalink
schrodinger test for bulk actions page
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Nov 4, 2019
1 parent 977b670 commit 1da104b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright (c) 2010-2019 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.testing.schrodinger.page;

import com.codeborne.selenide.Condition;
import com.evolveum.midpoint.schrodinger.page.configuration.BulkActionsPage;
import com.evolveum.midpoint.testing.schrodinger.TestBase;
import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Test;

import static com.codeborne.selenide.Selenide.$;

/**
* Created by Kate Honchar
*/
public class BulkActionsTest extends TestBase {

private static final String PARSING_ERROR_MESSAGE = "Couldn't parse bulk action object";

@Test
public void wrongBulkActionXmlExecution(){
BulkActionsPage bulkActionsPage = basicPage.bulkActions();
bulkActionsPage
.insertOneLineTextIntoEditor("<objects></objects>")
.startButtonClick();

$(By.linkText(PARSING_ERROR_MESSAGE))
.shouldBe(Condition.visible);

Assert.assertTrue(bulkActionsPage.isAceEditorVisible());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ base_url=http://localhost:8180/midpoint
webdriver=webdriver.chrome.driver
webdriverLocation=/opt/chromedriver
# By default if no value is specified for headless start then the value is: false
headlessStart=true
headlessStart=true
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,35 @@
*/
package com.evolveum.midpoint.schrodinger.page.configuration;

import com.codeborne.selenide.Condition;
import com.evolveum.midpoint.schrodinger.MidPoint;
import com.evolveum.midpoint.schrodinger.page.BasicPage;
import com.evolveum.midpoint.schrodinger.util.Schrodinger;
import org.openqa.selenium.By;

import static com.codeborne.selenide.Selenide.$;

/**
* Created by Viliam Repan (lazyman).
*/
public class BulkActionsPage extends BasicPage {

public BulkActionsPage insertOneLineTextIntoEditor(String text){
$(By.className("ace_content"))
.$(By.className("ace_text-layer"))
.$(By.className("ace_line"))
.setValue(text);
return this;
}

public BulkActionsPage startButtonClick(){
$(Schrodinger.byDataId("a", "start"))
.waitUntil(Condition.visible, MidPoint.TIMEOUT_DEFAULT_2_S)
.click();
return this;
}

public boolean isAceEditorVisible(){
return $(By.className("aceEditor")).exists();
}
}

0 comments on commit 1da104b

Please sign in to comment.