1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.panels.test.po; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.List; |
24 |
|
|
25 |
|
import org.openqa.selenium.By; |
26 |
|
import org.openqa.selenium.WebElement; |
27 |
|
import org.xwiki.test.ui.po.ViewPage; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 88.9% |
Uncovered Elements: 2 (18) |
Complexity: 6 |
Complexity Density: 0.55 |
|
35 |
|
public class ApplicationsPanel extends ViewPage |
36 |
|
{ |
37 |
|
|
38 |
|
@return |
39 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
40 |
9 |
public static ApplicationsPanel gotoPage()... |
41 |
|
{ |
42 |
9 |
getUtil().gotoPage("Panels", "Applications"); |
43 |
9 |
return new ApplicationsPanel(); |
44 |
|
} |
45 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
0 |
public static String getURL()... |
47 |
|
{ |
48 |
0 |
return getUtil().getURL("Panels", "Applications"); |
49 |
|
} |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
1 |
public boolean containsApplication(String applicationName)... |
52 |
|
{ |
53 |
1 |
return getDriver().findElementsWithoutWaiting(By.xpath( |
54 |
|
"//a/span[@class=\"application-label\" and contains(text(), '" + applicationName + "')]")).size() == 1; |
55 |
|
} |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
57 |
5 |
public ViewPage clickApplication(String applicationName)... |
58 |
|
{ |
59 |
5 |
getDriver().findElementWithoutWaiting(By.xpath( |
60 |
|
"//a/span[@class=\"application-label\" and contains(text(), '" + applicationName + "')]")).click(); |
61 |
5 |
return new ViewPage(); |
62 |
|
} |
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
64 |
3 |
public List<String> getApplications()... |
65 |
|
{ |
66 |
3 |
List<String> applications = new ArrayList<>(); |
67 |
|
|
68 |
3 |
for (WebElement elem : getDriver().findElementsWithoutWaiting(By.cssSelector(".application-label"))) { |
69 |
14 |
if (elem.isDisplayed()) { |
70 |
11 |
applications.add(elem.getText()); |
71 |
|
} |
72 |
|
} |
73 |
|
|
74 |
3 |
return applications; |
75 |
|
} |
76 |
|
} |