Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8a0f42
commit 11d5b7b
Showing
4 changed files
with
111 additions
and
12 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
...t/src/test/java/com/evolveum/midpoint/testing/schrodinger/labs/BasicProvisioningTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package com.evolveum.midpoint.testing.schrodinger.labs; | ||
|
||
import com.evolveum.midpoint.schrodinger.page.user.ListUsersPage; | ||
import com.evolveum.midpoint.schrodinger.page.user.UserPage; | ||
import com.evolveum.midpoint.testing.schrodinger.TestBase; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import static com.codeborne.selenide.Selenide.$; | ||
|
||
/** | ||
* Created by honchar | ||
* covers LAB 4-1 | ||
*/ | ||
public class BasicProvisioningTest extends TestBase { | ||
|
||
private static final String USER_NAME_ATTRIBUTE = "Name"; | ||
private static final String USER_GIVEN_NAME_ATTRIBUTE = "Given name"; | ||
private static final String USER_FAMILY_NAME_ATTRIBUTE = "Family name"; | ||
private static final String USER_PASSWORD_ATTRIBUTE = "Value"; | ||
private static final String USER_ADMINISTRATIVE_STATUS_ATTRIBUTE = "Administrative status"; | ||
|
||
private static final String USER_NAME = "kirk"; | ||
private static final String USER_GIVEN_NAME = "Jim"; | ||
private static final String USER_FAMILY_NAME = "Kirk"; | ||
private static final String USER_PASSWORD = "abc123"; | ||
private static final String USER_ADMINISTRATIVE_STATUS = "enabled"; | ||
|
||
//todo dependsOnGroup | ||
@Test(groups={"lab_4_1"}) | ||
public void test001createUserKirk(){ | ||
//we use New user link in this test | ||
UserPage userPage = basicPage.newUser(); | ||
userPage | ||
.selectTabBasic() | ||
.form() | ||
.addAttributeValue(UserType.F_NAME, USER_NAME) | ||
.addAttributeValue(UserType.F_FAMILY_NAME, USER_FAMILY_NAME) | ||
.addAttributeValue(UserType.F_GIVEN_NAME, USER_GIVEN_NAME) | ||
//TODO set password and enable status | ||
// .addAttributeValue(ActivationType.F_ADMINISTRATIVE_STATUS, USER_ADMINISTRATIVE_STATUS) | ||
.and() | ||
.and() | ||
.clickSave(); | ||
|
||
ListUsersPage usersList = new ListUsersPage(); | ||
|
||
usersList | ||
.table() | ||
.search() | ||
.byName() | ||
.inputValue(USER_NAME) | ||
.updateSearch() | ||
.and() | ||
.clickByName(USER_NAME); | ||
|
||
//check name attribute value | ||
Assert.assertTrue(userPage | ||
.selectTabBasic() | ||
.form() | ||
.compareAttibuteValue(USER_NAME_ATTRIBUTE, USER_NAME)); | ||
|
||
//check given name attribute value | ||
Assert.assertTrue(userPage | ||
.selectTabBasic() | ||
.form() | ||
.compareAttibuteValue(USER_GIVEN_NAME_ATTRIBUTE, USER_GIVEN_NAME)); | ||
|
||
//check family name attribute value | ||
Assert.assertTrue(userPage | ||
.selectTabBasic() | ||
.form() | ||
.compareAttibuteValue(USER_FAMILY_NAME_ATTRIBUTE, USER_FAMILY_NAME)); | ||
|
||
//TODO check status, and password is set | ||
//check administrative status attribute value | ||
// Assert.assertTrue(userPage | ||
// .selectTabBasic() | ||
// .form() | ||
// .compareAttibuteValue(Schrodinger.qnameToString(ActivationType.F_ADMINISTRATIVE_STATUS), USER_ADMINISTRATIVE_STATUS)); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters