1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.ui.po; |
21 |
|
|
22 |
|
import java.util.List; |
23 |
|
|
24 |
|
import org.apache.commons.lang3.StringUtils; |
25 |
|
import org.openqa.selenium.WebElement; |
26 |
|
import org.openqa.selenium.support.FindBy; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
@version |
32 |
|
@since |
33 |
|
|
|
|
| 83.9% |
Uncovered Elements: 5 (31) |
Complexity: 9 |
Complexity Density: 0.47 |
|
34 |
|
public class DeletePageOutcomePage extends ViewPage |
35 |
|
{ |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
@FindBy(xpath = "//table[@class='centered']/tbody/tr/td") |
43 |
|
private WebElement deleter; |
44 |
|
|
45 |
|
@FindBy(xpath = "//p[@class='xwikimessage']") |
46 |
|
private WebElement message; |
47 |
|
|
48 |
|
@FindBy(xpath = "//*[@id = 'mainContentArea']//a[. = 'Restore']") |
49 |
|
private WebElement restoreLink; |
50 |
|
|
51 |
|
|
52 |
|
@since |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
1 |
public String getPageDeleter()... |
55 |
|
{ |
56 |
1 |
return this.deleter.getText(); |
57 |
|
} |
58 |
|
|
59 |
|
|
60 |
|
@since |
61 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
1 |
public String getMessage()... |
63 |
|
{ |
64 |
1 |
return this.message.getText(); |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
@return |
71 |
|
@since |
72 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
73 |
0 |
public ViewPage clickRestore()... |
74 |
|
{ |
75 |
0 |
this.restoreLink.click(); |
76 |
0 |
return new ViewPage(); |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
@return |
81 |
|
|
82 |
|
@since |
83 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
84 |
2 |
public boolean hasTerminalPagesInRecycleBin()... |
85 |
|
{ |
86 |
2 |
List<WebElement> messages = getDriver().findElementsByClassName("recyclebin-message"); |
87 |
2 |
for (WebElement message : messages) { |
88 |
3 |
if (StringUtils.equals(message.getText(), |
89 |
|
"The following versions of terminal pages are in the recycle bin:")) { |
90 |
1 |
return true; |
91 |
|
} |
92 |
|
} |
93 |
|
|
94 |
1 |
return false; |
95 |
|
} |
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
@return |
101 |
|
@since |
102 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
103 |
1 |
public DeletePageOutcomePage clickDeletePage()... |
104 |
|
{ |
105 |
1 |
List<WebElement> elements = getDriver().findElementsByCssSelector(".docs .action-delete"); |
106 |
1 |
if (!elements.isEmpty()) { |
107 |
1 |
getDriver().makeConfirmDialogSilent(true); |
108 |
1 |
elements.get(0).click(); |
109 |
|
} |
110 |
1 |
return new DeletePageOutcomePage(); |
111 |
|
} |
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
@return |
117 |
|
@since |
118 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
119 |
1 |
public DeletePageOutcomePage clickDeleteTerminalPage()... |
120 |
|
{ |
121 |
1 |
List<WebElement> elements = getDriver().findElementsByCssSelector(".terminal-docs .action-delete"); |
122 |
1 |
if (!elements.isEmpty()) { |
123 |
1 |
getDriver().makeConfirmDialogSilent(true); |
124 |
1 |
elements.get(0).click(); |
125 |
|
} |
126 |
1 |
return new DeletePageOutcomePage(); |
127 |
|
} |
128 |
|
} |