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.List; |
23 |
|
|
24 |
|
import org.openqa.selenium.By; |
25 |
|
import org.openqa.selenium.WebElement; |
26 |
|
import org.openqa.selenium.support.FindBy; |
27 |
|
import org.xwiki.test.ui.po.DocumentPicker; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 85% |
Uncovered Elements: 3 (20) |
Complexity: 6 |
Complexity Density: 0.46 |
|
35 |
|
public class TemplatesAdministrationSectionPage extends AdministrationSectionPage |
36 |
|
{ |
37 |
|
public static final String ADMINISTRATION_SECTION_ID = "Templates"; |
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
@FindBy(className = "location-picker") |
43 |
|
private WebElement documentPickerElement; |
44 |
|
|
45 |
|
private DocumentPicker documentPicker; |
46 |
|
|
47 |
|
@FindBy(id = "createTemplateProvider") |
48 |
|
private WebElement createButton; |
49 |
|
|
50 |
|
|
51 |
|
@since |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
53 |
3 |
public static TemplatesAdministrationSectionPage gotoPage()... |
54 |
|
{ |
55 |
3 |
AdministrationSectionPage.gotoPage(ADMINISTRATION_SECTION_ID); |
56 |
3 |
return new TemplatesAdministrationSectionPage(); |
57 |
|
} |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
3 |
public TemplatesAdministrationSectionPage()... |
60 |
|
{ |
61 |
3 |
super(ADMINISTRATION_SECTION_ID); |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
|
@return |
66 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
67 |
3 |
public DocumentPicker getDocumentPicker()... |
68 |
|
{ |
69 |
3 |
if (this.documentPicker == null) { |
70 |
3 |
this.documentPicker = new DocumentPicker(this.documentPickerElement); |
71 |
|
} |
72 |
|
|
73 |
3 |
return this.documentPicker; |
74 |
|
} |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
76 |
3 |
public TemplateProviderInlinePage createTemplateProvider(String space, String page)... |
77 |
|
{ |
78 |
3 |
DocumentPicker documentPicker = getDocumentPicker(); |
79 |
3 |
documentPicker.toggleLocationAdvancedEdit(); |
80 |
3 |
documentPicker.setParent(space); |
81 |
3 |
documentPicker.setName(page); |
82 |
3 |
this.createButton.click(); |
83 |
|
|
84 |
3 |
return new TemplateProviderInlinePage(); |
85 |
|
} |
86 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
87 |
0 |
public List<WebElement> getExistingTemplatesLinks()... |
88 |
|
{ |
89 |
|
|
90 |
0 |
return getDriver().findElements(By.xpath("//ul[preceding-sibling::*[. = 'Available Template Providers']]//a")); |
91 |
|
} |
92 |
|
} |