Skip to content

Commit

Permalink
ADD disableAccount test, selectOption method for prism form
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmacik committed May 7, 2018
1 parent 41ee783 commit 9b01a84
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
Expand Up @@ -142,4 +142,14 @@ private SelenideElement findProperty(QName qname) {
String name = Schrodinger.qnameToString(qname);
return $(Schrodinger.byDataQName(name));
}

public PrismForm<T> selectOption(String attributeName, String option) {

SelenideElement property = findProperty(attributeName);

property.$(By.xpath(".//select[contains(@class,\"form-control\")]"))
.waitUntil(Condition.appears, MidPoint.TIMEOUT_DEFAULT).selectOption(option);

return this;
}
}
32 changes: 29 additions & 3 deletions tools/schrodinger/src/test/java/schrodinger/core/AccountTests.java
Expand Up @@ -6,6 +6,7 @@
import com.evolveum.midpoint.schrodinger.page.user.ListUsersPage;
import com.evolveum.midpoint.schrodinger.page.user.UserPage;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import org.apache.commons.io.FileUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -41,7 +42,7 @@ public class AccountTests extends TestBase {

@BeforeSuite
private void init() throws IOException {
// FileUtils.copyFile(CSV_SOURCE_FILE,CSV_TARGET_FILE);
FileUtils.copyFile(CSV_SOURCE_FILE,CSV_TARGET_FILE);
}

@Test(priority = 1)
Expand Down Expand Up @@ -144,7 +145,7 @@ public void modifyAccountAttribute(){
;

}
@Test
@Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY})
public void modifyAccountPassword(){
ListUsersPage users = basicPage.listUsers();
users
Expand All @@ -168,7 +169,32 @@ public void modifyAccountPassword(){
.feedback()
.isSuccess();

Selenide.sleep(5000);


}
@Test (dependsOnMethods = {ADD_ACCOUNT_DEPENDENCY})
public void disableAccount(){
ListUsersPage users = basicPage.listUsers();
users
.table()
.search()
.byName()
.inputValue(TEST_USER_MIKE_NAME)
.updateSearch()
.and()
.clickByName(TEST_USER_MIKE_NAME)
.selectTabProjections()
.table()
.clickByName(CSV_RESOURCE_NAME)
.selectOption("Administrative status","Disabled")
.and()
.and()
.and()
.checkKeepDisplayingResults()
.clickSave()
.feedback()
.isSuccess();
;
Selenide.sleep(5000);
}
}

0 comments on commit 9b01a84

Please sign in to comment.