1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.user.directory.test.ui; |
21 |
|
|
22 |
|
import org.junit.Rule; |
23 |
|
import org.junit.Test; |
24 |
|
import org.xwiki.test.ui.AbstractTest; |
25 |
|
import org.xwiki.test.ui.SuperAdminAuthenticationRule; |
26 |
|
import org.xwiki.test.ui.po.LiveTableElement; |
27 |
|
import org.xwiki.user.directory.test.po.UserDirectoryPage; |
28 |
|
|
29 |
|
import static org.junit.Assert.assertEquals; |
30 |
|
import static org.junit.Assert.assertTrue; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.07 |
|
38 |
|
public class UserDirectoryTest extends AbstractTest |
39 |
|
{ |
40 |
|
@Rule |
41 |
|
public SuperAdminAuthenticationRule authenticationRule = new SuperAdminAuthenticationRule(getUtil()); |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
43 |
1 |
@Test... |
44 |
|
public void verifyUserIsListed() |
45 |
|
{ |
46 |
|
|
47 |
1 |
getUtil().deletePage("XWiki", "test"); |
48 |
|
|
49 |
1 |
UserDirectoryPage page = UserDirectoryPage.gotoPage(); |
50 |
|
|
51 |
|
|
52 |
1 |
LiveTableElement liveTableElement = page.getUserDirectoryLiveTable(); |
53 |
1 |
assertEquals(0, liveTableElement.getRowCount()); |
54 |
|
|
55 |
|
|
56 |
1 |
getUtil().createUserAndLogin("test", "testtest", "first_name", "John", "last_name", "Doe"); |
57 |
|
|
58 |
1 |
page = UserDirectoryPage.gotoPage(); |
59 |
1 |
assertEquals(1, liveTableElement.getRowCount()); |
60 |
1 |
assertTrue(liveTableElement.hasRow("User ID", "test")); |
61 |
1 |
assertTrue(liveTableElement.hasRow("First Name", "John")); |
62 |
1 |
assertTrue(liveTableElement.hasRow("Last Name", "Doe")); |
63 |
|
|
64 |
|
|
65 |
1 |
getUtil().forceGuestUser(); |
66 |
1 |
assertEquals(1, liveTableElement.getRowCount()); |
67 |
1 |
assertTrue(liveTableElement.hasRow("User ID", "test")); |
68 |
1 |
assertTrue(liveTableElement.hasRow("First Name", "John")); |
69 |
1 |
assertTrue(liveTableElement.hasRow("Last Name", "Doe")); |
70 |
|
} |
71 |
|
} |