1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package org.xwiki.administration.test.po; |
22 |
|
|
23 |
|
import org.openqa.selenium.By; |
24 |
|
import org.openqa.selenium.WebElement; |
25 |
|
import org.openqa.selenium.support.FindBy; |
26 |
|
import org.xwiki.test.ui.po.BasePage; |
27 |
|
import org.xwiki.test.ui.po.LiveTableElement; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 92.3% |
Uncovered Elements: 2 (26) |
Complexity: 7 |
Complexity Density: 0.37 |
|
35 |
|
public class GroupsPage extends BasePage |
36 |
|
{ |
37 |
|
LiveTableElement groupsLiveTable = new LiveTableElement("groupstable"); |
38 |
|
|
39 |
|
@FindBy(id = "addNewGroup") |
40 |
|
private WebElement addGroupButton; |
41 |
|
|
42 |
|
@FindBy(css = "#addnewgroup .button.create") |
43 |
|
private WebElement createGroupButton; |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
2 |
public void clickAddNewGroupButton()... |
46 |
|
{ |
47 |
2 |
this.addGroupButton.click(); |
48 |
|
} |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
2 |
public void clickCreateGroupButton()... |
51 |
|
{ |
52 |
2 |
this.createGroupButton.click(); |
53 |
|
} |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
58 |
2 |
public GroupsPage addNewGroup(String groupName)... |
59 |
|
{ |
60 |
2 |
clickAddNewGroupButton(); |
61 |
|
|
62 |
|
|
63 |
2 |
getDriver().waitUntilElementIsVisible(By.id("newgroupi")); |
64 |
2 |
getDriver().findElementWithoutWaiting(By.id("newgroupi")).sendKeys(groupName); |
65 |
2 |
clickCreateGroupButton(); |
66 |
2 |
getDriver().waitUntilElementDisappears(By.id("lb")); |
67 |
|
|
68 |
2 |
GroupsPage groupsPage = new GroupsPage(); |
69 |
2 |
groupsPage.waitUntilPageIsLoaded(); |
70 |
2 |
return groupsPage; |
71 |
|
} |
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
76 |
1 |
public static GroupsPage gotoPage()... |
77 |
|
{ |
78 |
1 |
AdministrationPage.gotoPage().clickSection("Users & Groups", "Groups"); |
79 |
1 |
GroupsPage groupsPage = new GroupsPage(); |
80 |
1 |
groupsPage.waitUntilPageIsLoaded(); |
81 |
1 |
return groupsPage; |
82 |
|
} |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
@see |
88 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
89 |
3 |
@Override... |
90 |
|
public BasePage waitUntilPageIsLoaded() |
91 |
|
{ |
92 |
3 |
super.waitUntilPageIsLoaded(); |
93 |
|
|
94 |
3 |
groupsLiveTable.waitUntilReady(); |
95 |
|
|
96 |
3 |
return this; |
97 |
|
} |
98 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
2 |
public LiveTableElement getGroupsTable()... |
100 |
|
{ |
101 |
2 |
return groupsLiveTable; |
102 |
|
} |
103 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
104 |
0 |
public void filterGroups(String group)... |
105 |
|
{ |
106 |
0 |
groupsLiveTable.filterColumn("name", group); |
107 |
|
} |
108 |
|
} |