1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.annotation.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.BaseElement; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 32.1% |
Uncovered Elements: 19 (28) |
Complexity: 9 |
Complexity Density: 0.56 |
|
33 |
|
public class AnnotationsPane extends BaseElement |
34 |
|
{ |
35 |
|
@FindBy(id = "annotationsdisplay") |
36 |
|
private WebElement checkBox; |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
38 |
2 |
private void clickOnAnnotationMenu()... |
39 |
|
{ |
40 |
2 |
String dropDownMenuXPath = "//div[@id='tmMoreActions']//ul[contains(@class, 'dropdown-menu')]"; |
41 |
|
|
42 |
|
|
43 |
2 |
getDriver().findElement(By.xpath("//div[@id='tmMoreActions']/a[contains(@role, 'button')]")).click(); |
44 |
|
|
45 |
2 |
getDriver().waitUntilElementIsVisible(By.xpath(dropDownMenuXPath)); |
46 |
|
|
47 |
2 |
WebElement annotationsPane = getDriver().findElement( |
48 |
|
By.xpath(dropDownMenuXPath + "//a[contains(., 'Annotate')]")); |
49 |
2 |
annotationsPane.click(); |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
55 |
2 |
public void showAnnotationsPane()... |
56 |
|
{ |
57 |
2 |
clickOnAnnotationMenu(); |
58 |
|
|
59 |
2 |
getDriver().waitUntilElementIsVisible(By.className("annotationsettings")); |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
65 |
0 |
public void hideAnnotationsPane()... |
66 |
|
{ |
67 |
0 |
clickOnAnnotationMenu(); |
68 |
|
|
69 |
0 |
getDriver().waitUntilElementDisappears(By.className("annotationsettings")); |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
75 |
0 |
public void clickShowAnnotations()... |
76 |
|
{ |
77 |
0 |
if (this.checkBox.isSelected() == false) { |
78 |
0 |
this.checkBox.click(); |
79 |
|
} |
80 |
|
} |
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
85 |
0 |
public void clickHideAnnotations()... |
86 |
|
{ |
87 |
0 |
if (this.checkBox.isSelected() == true) { |
88 |
0 |
this.checkBox.click(); |
89 |
|
} |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
@return |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
97 |
0 |
public boolean checkIfShowAnnotationsCheckboxExists()... |
98 |
|
{ |
99 |
0 |
if (getDriver().findElementsWithoutWaiting(By.id("annotationsdisplay")).size() > 0) { |
100 |
0 |
return true; |
101 |
|
} else { |
102 |
0 |
return false; |
103 |
|
} |
104 |
|
} |
105 |
|
} |