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.editor; |
21 |
|
|
22 |
|
import org.openqa.selenium.WebElement; |
23 |
|
import org.openqa.selenium.support.FindBy; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
@version |
29 |
|
@since |
30 |
|
|
|
|
| 96.7% |
Uncovered Elements: 1 (30) |
Complexity: 14 |
Complexity Density: 0.82 |
|
31 |
|
public class WikiEditPage extends PreviewableEditPage |
32 |
|
{ |
33 |
|
@FindBy(id = "xwikidoctitleinput") |
34 |
|
private WebElement titleInput; |
35 |
|
|
36 |
|
@FindBy(id = "xwikidocparentinput") |
37 |
|
private WebElement parentInput; |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
@FindBy(id = "editParentTrigger") |
43 |
|
private WebElement editParentTrigger; |
44 |
|
|
45 |
|
@FindBy(id = "content") |
46 |
|
private WebElement contentText; |
47 |
|
|
48 |
|
@FindBy(name = "minorEdit") |
49 |
|
private WebElement minorEditCheckBox; |
50 |
|
|
51 |
|
@FindBy(name = "comment") |
52 |
|
private WebElement commentInput; |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
57 |
24 |
public static WikiEditPage gotoPage(String space, String page)... |
58 |
|
{ |
59 |
24 |
getUtil().gotoPage(space, page, "edit", "editor=wiki"); |
60 |
24 |
return new WikiEditPage(); |
61 |
|
} |
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
4 |
public String getTitle()... |
67 |
|
{ |
68 |
4 |
return this.titleInput.getAttribute("value"); |
69 |
|
} |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
74 |
4 |
public void setTitle(String title)... |
75 |
|
{ |
76 |
4 |
this.titleInput.clear(); |
77 |
4 |
this.titleInput.sendKeys(title); |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
|
@return |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
2 |
public String getParent()... |
84 |
|
{ |
85 |
2 |
return this.parentInput.getAttribute("value"); |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
@param |
92 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
93 |
1 |
public void setParent(String parent)... |
94 |
|
{ |
95 |
1 |
if (!this.parentInput.isDisplayed()) { |
96 |
1 |
this.editParentTrigger.click(); |
97 |
|
} |
98 |
1 |
this.parentInput.clear(); |
99 |
1 |
this.parentInput.sendKeys(parent); |
100 |
|
} |
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
13 |
public String getContent()... |
106 |
|
{ |
107 |
13 |
return this.contentText.getText(); |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
113 |
27 |
public void setContent(String content)... |
114 |
|
{ |
115 |
27 |
this.contentText.clear(); |
116 |
27 |
this.contentText.sendKeys(content); |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 5 |
Complexity Density: 2.5 |
|
122 |
2 |
public void setMinorEdit(boolean value)... |
123 |
|
{ |
124 |
2 |
if ((this.minorEditCheckBox.isSelected() && !value) |
125 |
|
|| (!this.minorEditCheckBox.isSelected() && value)) |
126 |
|
{ |
127 |
1 |
this.minorEditCheckBox.click(); |
128 |
|
} |
129 |
|
} |
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
134 |
2 |
public void setEditComment(String comment)... |
135 |
|
{ |
136 |
2 |
this.commentInput.clear(); |
137 |
2 |
this.commentInput.sendKeys(comment); |
138 |
|
} |
139 |
|
} |