1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.administration.test.po; |
21 |
|
|
22 |
|
import org.openqa.selenium.By; |
23 |
|
import org.openqa.selenium.WebElement; |
24 |
|
import org.openqa.selenium.support.FindBy; |
25 |
|
import org.xwiki.test.ui.po.EditRightsPane; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 61.8% |
Uncovered Elements: 13 (34) |
Complexity: 12 |
Complexity Density: 0.67 |
|
33 |
|
public class GlobalRightsAdministrationSectionPage extends AdministrationSectionPage |
34 |
|
{ |
35 |
|
@FindBy(id = "guest_comment_requires_captcha") |
36 |
|
private WebElement captchaCheckBox; |
37 |
|
|
38 |
|
@FindBy(id = "authenticate_view") |
39 |
|
WebElement forceAuthenticatedViewLink; |
40 |
|
|
41 |
|
private EditRightsPane editRightsPane = new EditRightsPane(); |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
43 |
2 |
public GlobalRightsAdministrationSectionPage()... |
44 |
|
{ |
45 |
2 |
super("Rights"); |
46 |
|
} |
47 |
|
|
48 |
|
|
49 |
|
@since |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
51 |
1 |
public static GlobalRightsAdministrationSectionPage gotoPage()... |
52 |
|
{ |
53 |
1 |
getUtil().gotoPage("XWiki", "XWikiPreferences", "admin", "editor=globaladmin§ion=Rights"); |
54 |
1 |
return new GlobalRightsAdministrationSectionPage(); |
55 |
|
} |
56 |
|
|
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
1 |
public void forceAuthenticatedView()... |
59 |
|
{ |
60 |
1 |
setAuthenticatedView(true); |
61 |
|
} |
62 |
|
|
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
1 |
public void unforceAuthenticatedView()... |
65 |
|
{ |
66 |
1 |
setAuthenticatedView(false); |
67 |
|
} |
68 |
|
|
|
|
| 91.7% |
Uncovered Elements: 1 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
69 |
2 |
private void setAuthenticatedView(boolean enabled)... |
70 |
|
{ |
71 |
2 |
String desiredAltValue = enabled ? "yes" : "no"; |
72 |
|
|
73 |
2 |
if (!this.forceAuthenticatedViewLink.getAttribute("alt").equals(desiredAltValue)) { |
74 |
2 |
this.forceAuthenticatedViewLink.click(); |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
2 |
int defaultTimeout = getDriver().getTimeout(); |
79 |
2 |
try { |
80 |
2 |
getDriver().setTimeout(defaultTimeout * 2); |
81 |
2 |
getDriver().waitUntilElementHasAttributeValue( |
82 |
|
By.id(this.forceAuthenticatedViewLink.getAttribute("id")), "alt", desiredAltValue); |
83 |
|
} finally { |
84 |
|
|
85 |
2 |
getDriver().setTimeout(defaultTimeout); |
86 |
|
} |
87 |
|
} |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
90 |
0 |
public void disableCAPTCHA()... |
91 |
|
{ |
92 |
0 |
if (this.captchaCheckBox.isSelected()) { |
93 |
0 |
this.captchaCheckBox.click(); |
94 |
|
} |
95 |
|
} |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
97 |
0 |
public void enableCAPTCHA()... |
98 |
|
{ |
99 |
0 |
if (!this.captchaCheckBox.isSelected()) { |
100 |
0 |
this.captchaCheckBox.click(); |
101 |
|
} |
102 |
|
} |
103 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
104 |
0 |
public EditRightsPane getEditRightsPane()... |
105 |
|
{ |
106 |
0 |
return this.editRightsPane; |
107 |
|
} |
108 |
|
} |