Skip to content

Commit

Permalink
ADD PolyStringTests suite , FIX typo in Search component class
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmacik committed May 21, 2018
1 parent 81b3b8f commit 2078a70
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 12 deletions.
Expand Up @@ -43,10 +43,10 @@ public Popover<Search<T>> byName() {
for (SelenideElement popoverElement : popoverElements) {
if (popoverElement.isDisplayed()) {
popover = popoverElement;
break;
break;t
}
}
return new PoSpover<>(this, popover);
return new Popover<>(this, popover);
}
}

Expand Up @@ -88,6 +88,14 @@ public static By byElementValue(String elementName, String value) {
return By.xpath("//" + elementName + "[text()='" + value + "']");
}

public static By byElementValueConcrete(String elementName, String value) {
if (elementName == null) {
elementName = "*";
}

return By.xpath("//" + elementName + "contains(.,\"" + value + "\"");
}

public static By bySelfOrAncestorElementAttributeValue(String element, String attr, String attrValue, String ancestorAttr, String ancestorAttrValue) {
if (element == null) {
element = "*";
Expand Down
Expand Up @@ -20,14 +20,14 @@ public class OrganizationStructureTests extends TestBase {

private static final File CSV_RESOURCE_ADVANCED_SYNC = new File("../../samples/resources/csv/resource-csv-groups.xml");

protected static final File CSV_SOURCE_FILE = new File("../../samples/resources/csv/midpoint-groups.csv");
protected static final File CSV_TARGET_FILE = new File("C:\\Users\\matus\\Documents\\apache-tomcat-8.5.16\\target\\midpoint-advanced-sync.csv"); //TODO change hard coded path to local web container
protected static final File ORG_ACCOUNT_INDUCEMENT_FILE = new File("./src/test/resources/org-account-inducement.xml");
protected static final File ORG_MONKEY_ISLAND_SOURCE_FILE = new File("../../samples/org/org-monkey-island-simple.xml");
private static final File CSV_SOURCE_FILE = new File("../../samples/resources/csv/midpoint-groups.csv");
private static final File CSV_TARGET_FILE = new File("C:\\Users\\matus\\Documents\\apache-tomcat-8.5.16\\target\\midpoint-advanced-sync.csv"); //TODO change hard coded path to local web container
private static final File ORG_ACCOUNT_INDUCEMENT_FILE = new File("./src/test/resources/org-account-inducement.xml");
private static final File ORG_MONKEY_ISLAND_SOURCE_FILE = new File("../../samples/org/org-monkey-island-simple.xml");

protected static final File USER_TEST_RAPHAEL_FILE = new File("./src/test/resources/user-raphael.xml");
private static final File USER_TEST_RAPHAEL_FILE = new File("./src/test/resources/user-raphael.xml");

protected static final String CSV_SOURCE_OLDVALUE = "target/midpoint.csv";
private static final String CSV_SOURCE_OLDVALUE = "target/midpoint.csv";

private static final String TEST_USER_GUYBRUSH_NAME = "guybrush";
private static final String TEST_USER_RAPHAEL_NAME = "raphael";
Expand Down
@@ -0,0 +1,68 @@
package schrodinger.scenarios;

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.testng.Assert;
import org.testng.annotations.Test;
import schrodinger.TestBase;

/**
* Created by matus on 5/21/2018.
*/
public class PolyStringTests extends TestBase {

private static final String TEST_USER_JOZKO_NAME = "džordž";
private static final String TEST_USER_JOZKO_NAME_NO_DIAC = "dzordz";
private static final String TEST_USER_JOZKO_GIVEN_NAME = "Jožko";
private static final String TEST_USER_JOZKO_FAMILY_NAME = "Mrkvička";
private static final String TEST_USER_JOZKO_FULL_NAME = "Jožko Jörg Nguyễn Trißtan Guðmund Mrkvička";
private static final String TEST_USER_JOZKO_ADDITIONAL_NAME = "Jörg Nguyễn Trißtan Guðmund ";

@Test
public void createUserWithDiacritic(){
UserPage user = basicPage.newUser();

Assert.assertTrue(user.selectTabBasic()
.form()
.addAttributeValue("name", TEST_USER_JOZKO_NAME)
.addAttributeValue(UserType.F_GIVEN_NAME, TEST_USER_JOZKO_GIVEN_NAME)
.addAttributeValue(UserType.F_FAMILY_NAME, TEST_USER_JOZKO_FAMILY_NAME)
.addAttributeValue(UserType.F_FULL_NAME,TEST_USER_JOZKO_FULL_NAME)
.addAttributeValue(UserType.F_ADDITIONAL_NAME,TEST_USER_JOZKO_ADDITIONAL_NAME)
.and()
.and()
.checkKeepDisplayingResults()
.clickSave()
.feedback()
.isSuccess()
);

}

@Test
public void searchForUserWithDiacritic(){

ListUsersPage usersPage = basicPage.listUsers();
Assert.assertTrue(
usersPage
.table()
.search()
.byName()
.inputValue(TEST_USER_JOZKO_NAME)
.updateSearch()
.and()
.currentTableContains(TEST_USER_JOZKO_NAME)
);
usersPage
.table()
.search()
.byName()
.inputValue(TEST_USER_JOZKO_NAME_NO_DIAC)
.updateSearch()
.and()
.currentTableContains(TEST_USER_JOZKO_NAME_NO_DIAC);

}

}
Expand Up @@ -15,11 +15,11 @@
public class UserPhotoTests extends TestBase {

private static final String TEST_USER_LEO_NAME= "leonardo";
protected static final File PHOTO_SOURCE_FILE_LARGE = new File("C:\\Users\\matus\\Documents\\apache-tomcat-8.5.16\\target\\leonardo_large.jpg");
protected static final File PHOTO_SOURCE_FILE_SMALL= new File("C:\\Users\\matus\\Documents\\apache-tomcat-8.5.16\\target\\leonardo_small.jpg");
private static final File PHOTO_SOURCE_FILE_LARGE = new File("C:\\Users\\matus\\Documents\\apache-tomcat-8.5.16\\target\\leonardo_large.jpg");
private static final File PHOTO_SOURCE_FILE_SMALL= new File("C:\\Users\\matus\\Documents\\apache-tomcat-8.5.16\\target\\leonardo_small.jpg");

protected static final String CREATE_USER_WITH_LARGE_PHOTO_DEPENDENCY = "createMidpointUserWithPhotoLarge";
protected static final String CREATE_USER_WITH_NORMAL_PHOTO_DEPENDENCY = "createMidpointUserWithPhotoJustRight";
private static final String CREATE_USER_WITH_LARGE_PHOTO_DEPENDENCY = "createMidpointUserWithPhotoLarge";
private static final String CREATE_USER_WITH_NORMAL_PHOTO_DEPENDENCY = "createMidpointUserWithPhotoJustRight";

@Test
public void createMidpointUserWithPhotoLarge(){
Expand Down

0 comments on commit 2078a70

Please sign in to comment.