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 org.openqa.selenium.By; |
23 |
|
import org.openqa.selenium.WebElement; |
24 |
|
import org.openqa.selenium.support.FindBy; |
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 6 |
Complexity Density: 0.86 |
|
33 |
|
public class ConfirmationPage extends ViewPage |
34 |
|
{ |
35 |
|
@FindBy(xpath = "//*[(contains(@class, 'btn') or contains(@class, 'button')) " |
36 |
|
+ "and (contains(@value, 'Yes') or contains(text(), 'Yes'))]") |
37 |
|
private WebElement yesButton; |
38 |
|
|
39 |
|
@FindBy(xpath = "//*[(contains(@class, 'btn') or contains(@class, 'button')) " |
40 |
|
+ "and (contains(@value, 'No') or contains(text(), 'No'))]") |
41 |
|
private WebElement noButton; |
42 |
|
|
43 |
|
@FindBy(id = "affectChildren") |
44 |
|
private WebElement affectChildren; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
11 |
public void clickYes()... |
50 |
|
{ |
51 |
11 |
this.yesButton.click(); |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
2 |
public void clickNo()... |
58 |
|
{ |
59 |
2 |
this.noButton.click(); |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
@return |
64 |
|
@since |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
3 |
public boolean hasAffectChildrenOption()... |
67 |
|
{ |
68 |
3 |
return getDriver().hasElementWithoutWaiting(By.id("affectChildren")); |
69 |
|
} |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
@param |
74 |
|
@since |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
76 |
2 |
public void setAffectChildren(boolean value)... |
77 |
|
{ |
78 |
2 |
if (affectChildren.isSelected() != value) { |
79 |
1 |
affectChildren.click(); |
80 |
|
} |
81 |
|
} |
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
@return |
86 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
87 |
3 |
public DeletingPage confirmDeletePage()... |
88 |
|
{ |
89 |
3 |
clickYes(); |
90 |
3 |
return new DeletingPage(); |
91 |
|
} |
92 |
|
} |