1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.appwithinminutes.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.openqa.selenium.support.FindBys; |
26 |
|
import org.xwiki.test.ui.po.ConfirmationPage; |
27 |
|
import org.xwiki.test.ui.po.InlinePage; |
28 |
|
import org.xwiki.test.ui.po.LiveTableElement; |
29 |
|
import org.xwiki.test.ui.po.ViewPage; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 84.6% |
Uncovered Elements: 4 (26) |
Complexity: 9 |
Complexity Density: 0.56 |
|
37 |
|
public class ApplicationHomePage extends ViewPage |
38 |
|
{ |
39 |
|
@FindBys({@FindBy(id = "actionBox"), @FindBy(className = "add")}) |
40 |
|
private WebElement addEntryLink; |
41 |
|
|
42 |
|
@FindBys({@FindBy(id = "actionBox"), @FindBy(className = "edit")}) |
43 |
|
private WebElement editClassLink; |
44 |
|
|
45 |
|
@FindBy(css = "#actionBox .action.deleteData") |
46 |
|
private WebElement deleteAllEntriesLink; |
47 |
|
|
48 |
|
@FindBy(css = "#actionBox .action.delete") |
49 |
|
private WebElement deleteApplicationLink; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
private LiveTableElement entriesLiveTable; |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
@param |
60 |
|
@return |
61 |
|
@since |
62 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
63 |
0 |
public static ApplicationHomePage gotoPage(String appName)... |
64 |
|
{ |
65 |
0 |
getUtil().gotoPage(appName, "WebHome"); |
66 |
0 |
return new ApplicationHomePage(); |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
@return |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
74 |
8 |
public EntryNamePane clickAddNewEntry()... |
75 |
|
{ |
76 |
8 |
addEntryLink.click(); |
77 |
8 |
return new EntryNamePane(); |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
@return |
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
85 |
1 |
public ApplicationClassEditPage clickEditApplication()... |
86 |
|
{ |
87 |
1 |
editClassLink.click(); |
88 |
1 |
return new ApplicationClassEditPage(); |
89 |
|
} |
90 |
|
|
91 |
|
|
92 |
|
@return |
93 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
94 |
11 |
public LiveTableElement getEntriesLiveTable()... |
95 |
|
{ |
96 |
11 |
if (entriesLiveTable == null) { |
97 |
11 |
WebElement table = getDriver().findElement(By.className("xwiki-livetable")); |
98 |
11 |
entriesLiveTable = new LiveTableElement(table.getAttribute("id")); |
99 |
|
} |
100 |
11 |
return entriesLiveTable; |
101 |
|
} |
102 |
|
|
103 |
|
|
104 |
|
@return |
105 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
106 |
1 |
public boolean hasEntriesLiveTable()... |
107 |
|
{ |
108 |
1 |
return getDriver().findElements(By.className("xwiki-livetable")).size() > 0; |
109 |
|
} |
110 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
111 |
1 |
public ConfirmationPage clickDeleteAllEntries()... |
112 |
|
{ |
113 |
1 |
this.deleteAllEntriesLink.click(); |
114 |
1 |
return new ConfirmationPage(); |
115 |
|
} |
116 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
117 |
1 |
public ConfirmationPage clickDeleteApplication()... |
118 |
|
{ |
119 |
1 |
this.deleteApplicationLink.click(); |
120 |
1 |
return new ConfirmationPage(); |
121 |
|
} |
122 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
123 |
1 |
@SuppressWarnings("unchecked")... |
124 |
|
@Override |
125 |
|
protected <T extends InlinePage> T createInlinePage() |
126 |
|
{ |
127 |
1 |
return (T) new ApplicationHomeEditPage(); |
128 |
|
} |
129 |
|
} |