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.By; |
23 |
|
import org.xwiki.test.ui.po.BaseElement; |
24 |
|
import org.xwiki.test.ui.po.FormElement; |
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
@version |
30 |
|
@since |
31 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 5 |
Complexity Density: 0.45 |
|
32 |
|
public class ClassPropertyEditPane extends BaseElement |
33 |
|
{ |
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
private final FormElement form; |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
private final String propertyName; |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
@param |
48 |
|
@param |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
50 |
23 |
public ClassPropertyEditPane(FormElement form, String propertyName)... |
51 |
|
{ |
52 |
23 |
this.form = form; |
53 |
23 |
this.propertyName = propertyName; |
54 |
|
} |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
@return |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
61 |
23 |
public ClassPropertyEditPane expand()... |
62 |
|
{ |
63 |
23 |
By containerLocator = By.id("xproperty_" + propertyName); |
64 |
23 |
By titleLocator = By.id("xproperty_" + propertyName + "_title"); |
65 |
23 |
getDriver().waitUntilElementIsVisible(containerLocator); |
66 |
23 |
if (getDriver().findElementWithoutWaiting(containerLocator).getAttribute("class").contains("collapsed")) { |
67 |
18 |
getDriver().findElementWithoutWaiting(titleLocator).click(); |
68 |
|
} |
69 |
23 |
return this; |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
@param |
76 |
|
@param |
77 |
|
@return |
78 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
79 |
15 |
protected ClassPropertyEditPane setMetaProperty(String metaPropertyName, String value)... |
80 |
|
{ |
81 |
15 |
form.setFieldValue(By.id(propertyName + "_" + metaPropertyName), value); |
82 |
15 |
return this; |
83 |
|
} |
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
@param |
89 |
|
@return |
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
91 |
2 |
public ClassPropertyEditPane setPrettyName(String prettyName)... |
92 |
|
{ |
93 |
2 |
return setMetaProperty("prettyName", prettyName); |
94 |
|
} |
95 |
|
} |