1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.administration.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.openqa.selenium.support.FindBy; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 4 |
Complexity Density: 0.4 |
|
35 |
|
public class WYSIWYGEditorAdministrationSectionPage extends AdministrationSectionPage |
36 |
|
{ |
37 |
|
@FindBy(xpath = "//input[@type = 'submit' and @name = 'action_saveandcontinue']") |
38 |
|
private WebElement saveButton; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
@FindBy(xpath = "//div[@class = 'hSortableWrapper'][1]//input[@type = 'text']") |
44 |
|
private WebElement pluginInput; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@FindBy(xpath = "//div[@class = 'hSortableWrapper'][1]//input[@type = 'image']") |
50 |
|
private WebElement enablePluginButton; |
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
2 |
public WYSIWYGEditorAdministrationSectionPage()... |
53 |
|
{ |
54 |
2 |
super("WYSIWYG"); |
55 |
|
} |
56 |
|
|
57 |
|
|
58 |
|
@return |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
60 |
2 |
public List<String> getEnabledPlugins()... |
61 |
|
{ |
62 |
2 |
List<String> plugins = new ArrayList<String>(); |
63 |
2 |
for (WebElement value : getDriver().findElements( |
64 |
|
By.xpath("//div[@class = 'hSortableWrapper'][1]//span[@class = 'value']"))) { |
65 |
105 |
plugins.add(value.getText()); |
66 |
|
} |
67 |
2 |
return plugins; |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
@param |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
75 |
1 |
public void enablePlugin(String name)... |
76 |
|
{ |
77 |
1 |
pluginInput.clear(); |
78 |
1 |
pluginInput.sendKeys(name); |
79 |
1 |
enablePluginButton.click(); |
80 |
|
} |
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
85 |
1 |
@Override... |
86 |
|
public void clickSave() |
87 |
|
{ |
88 |
1 |
this.saveButton.click(); |
89 |
|
|
90 |
1 |
waitForNotificationSuccessMessage("Saved"); |
91 |
|
} |
92 |
|
} |