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.Keys; |
24 |
|
import org.openqa.selenium.WebElement; |
25 |
|
import org.openqa.selenium.support.FindBy; |
26 |
|
import org.openqa.selenium.support.ui.Select; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 48.4% |
Uncovered Elements: 16 (31) |
Complexity: 11 |
Complexity Density: 0.55 |
|
35 |
|
public class ApplicationTemplateProviderEditPage extends ApplicationEditPage |
36 |
|
{ |
37 |
|
@FindBy(id = "XWiki.TemplateProviderClass_0_icon") |
38 |
|
private WebElement iconInput; |
39 |
|
|
40 |
|
@FindBy(id = "XWiki.TemplateProviderClass_0_description") |
41 |
|
private WebElement descriptionInput; |
42 |
|
|
43 |
|
@FindBy(id = "XWiki.TemplateProviderClass_0_creationRestrictionsAreSuggestions") |
44 |
|
private WebElement creationRestrictionsAreSuggestionsCheckBox; |
45 |
|
|
46 |
|
@FindBy(id = "XWiki.TemplateProviderClass_0_terminal") |
47 |
|
private WebElement terminalSelect; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
@return |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
54 |
9 |
public ApplicationHomeEditPage clickNextStep()... |
55 |
|
{ |
56 |
9 |
nextStepButton.click(); |
57 |
9 |
return new ApplicationHomeEditPage(); |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
@return |
64 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
65 |
2 |
public ApplicationClassEditPage clickPreviousStep()... |
66 |
|
{ |
67 |
2 |
previousStepButton.click(); |
68 |
2 |
return new ApplicationClassEditPage(); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
71 |
1 |
public ApplicationTemplateProviderEditPage setIcon(String icon)... |
72 |
|
{ |
73 |
1 |
this.iconInput.clear(); |
74 |
1 |
this.iconInput.sendKeys(icon); |
75 |
|
|
76 |
1 |
this.iconInput.sendKeys(Keys.ESCAPE); |
77 |
1 |
return this; |
78 |
|
} |
79 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
0 |
public String getIcon()... |
81 |
|
{ |
82 |
0 |
return this.iconInput.getText(); |
83 |
|
} |
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
85 |
1 |
public ApplicationTemplateProviderEditPage setDescription(String description)... |
86 |
|
{ |
87 |
1 |
this.descriptionInput.clear(); |
88 |
1 |
this.descriptionInput.sendKeys(description); |
89 |
1 |
return this; |
90 |
|
} |
91 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
92 |
0 |
public String getDescription()... |
93 |
|
{ |
94 |
0 |
return this.descriptionInput.getText(); |
95 |
|
} |
96 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
97 |
0 |
public ApplicationTemplateProviderEditPage clickEnforceEntryLocation()... |
98 |
|
{ |
99 |
0 |
this.creationRestrictionsAreSuggestionsCheckBox.click(); |
100 |
0 |
return this; |
101 |
|
} |
102 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
103 |
0 |
public boolean isEntryLocationEnforced()... |
104 |
|
{ |
105 |
0 |
return !this.creationRestrictionsAreSuggestionsCheckBox.isSelected(); |
106 |
|
} |
107 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
108 |
0 |
public ApplicationTemplateProviderEditPage setTerminal(String visibleText)... |
109 |
|
{ |
110 |
0 |
new Select(this.terminalSelect).deselectByVisibleText(visibleText); |
111 |
0 |
return this; |
112 |
|
} |
113 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
114 |
0 |
public String getTerminal()... |
115 |
|
{ |
116 |
0 |
return new Select(this.terminalSelect).getFirstSelectedOption().getText(); |
117 |
|
} |
118 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
119 |
0 |
public boolean hasTerminalOption()... |
120 |
|
{ |
121 |
0 |
return getDriver().findElementsWithoutWaiting(By.cssSelector("select#XWiki\\.TemplateProviderClass_0_terminal")) |
122 |
|
.size() > 0; |
123 |
|
} |
124 |
|
} |