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.Arrays; |
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 |
|
import org.xwiki.test.ui.po.BootstrapSelect; |
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
@version |
34 |
|
@since |
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 6 |
Complexity Density: 0.67 |
|
36 |
|
public class LocalizationAdministrationSectionPage extends AdministrationSectionPage |
37 |
|
{ |
38 |
|
@FindBy(xpath = "(//div[contains(@class, 'bootstrap-select')])[1]") |
39 |
|
private WebElement multiLingualSelect; |
40 |
|
|
41 |
|
@FindBy(xpath = "(//div[contains(@class, 'bootstrap-select')])[3]") |
42 |
|
private WebElement defaultLanguageSelect; |
43 |
|
|
44 |
|
@FindBy(xpath = "(//div[contains(@class, 'bootstrap-select')])[2]") |
45 |
|
private WebElement supportedLanguagesSelect; |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
47 |
14 |
public LocalizationAdministrationSectionPage()... |
48 |
|
{ |
49 |
14 |
super("Localization"); |
50 |
|
|
51 |
14 |
getDriver().waitUntilElementIsVisible(By.cssSelector(".bootstrap-select")); |
52 |
|
} |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
54 |
13 |
public void setMultiLingual(boolean isMultiLingual)... |
55 |
|
{ |
56 |
13 |
BootstrapSelect select = new BootstrapSelect(this.multiLingualSelect, getDriver()); |
57 |
13 |
select.selectByValue(isMultiLingual ? "1" : "0"); |
58 |
|
} |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
60 |
14 |
public void setDefaultLanguage(String defaultLanguage)... |
61 |
|
{ |
62 |
14 |
BootstrapSelect select = new BootstrapSelect(this.defaultLanguageSelect, getDriver()); |
63 |
14 |
select.selectByValue(defaultLanguage); |
64 |
|
} |
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
4 |
public void setSupportedLanguages(String supportedLanguages)... |
67 |
|
{ |
68 |
4 |
setSupportedLanguages(Arrays.asList(supportedLanguages.split(","))); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
71 |
5 |
public void setSupportedLanguages(List<String> supportedLanguages)... |
72 |
|
{ |
73 |
5 |
BootstrapSelect select = new BootstrapSelect(this.supportedLanguagesSelect, getDriver()); |
74 |
5 |
select.selectByValues(supportedLanguages); |
75 |
|
} |
76 |
|
} |