1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.administration.test.po

File LocalizationAdministrationSectionPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

2
9
5
1
76
40
6
0.67
1.8
5
1.2

Classes

Class Line # Actions
LocalizationAdministrationSectionPage 36 9 0% 6 0
1.0100%
 

Contributing tests

This file is covered by 5 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
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    * Represents the actions possible on the Localization Administration Page.
32    *
33    * @version $Id: 1c50a3a5c3c6c63d12ef6f503cf3ebe44940967f $
34    * @since 4.2M1
35    */
 
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   
 
47  14 toggle public LocalizationAdministrationSectionPage()
48    {
49  14 super("Localization");
50    // Wait for asynchronous widgets to be loaded
51  14 getDriver().waitUntilElementIsVisible(By.cssSelector(".bootstrap-select"));
52    }
53   
 
54  13 toggle public void setMultiLingual(boolean isMultiLingual)
55    {
56  13 BootstrapSelect select = new BootstrapSelect(this.multiLingualSelect, getDriver());
57  13 select.selectByValue(isMultiLingual ? "1" : "0");
58    }
59   
 
60  14 toggle public void setDefaultLanguage(String defaultLanguage)
61    {
62  14 BootstrapSelect select = new BootstrapSelect(this.defaultLanguageSelect, getDriver());
63  14 select.selectByValue(defaultLanguage);
64    }
65   
 
66  4 toggle public void setSupportedLanguages(String supportedLanguages)
67    {
68  4 setSupportedLanguages(Arrays.asList(supportedLanguages.split(",")));
69    }
70   
 
71  5 toggle public void setSupportedLanguages(List<String> supportedLanguages)
72    {
73  5 BootstrapSelect select = new BootstrapSelect(this.supportedLanguagesSelect, getDriver());
74  5 select.selectByValues(supportedLanguages);
75    }
76    }