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

File ColorThemePropertyDisplayerPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart0.png
83% of files have more coverage

Code metrics

0
17
7
1
99
53
7
0.41
2.43
7
1

Classes

Class Line # Actions
ColorThemePropertyDisplayerPage 36 17 0% 7 24
0.00%
 

Contributing tests

No tests hitting this source file were found.

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.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    import org.xwiki.test.ui.po.ViewPage;
29   
30    /**
31    * Class that represents the page which hold the displayer for the 'color theme' property of the Administration.
32    *
33    * @since 6.3M2
34    * @version $Id: 01af50d45b5cb6b4dfe9fa804671474e150fa938 $
35    */
 
36    public class ColorThemePropertyDisplayerPage extends ViewPage
37    {
38    /**
39    * The select input to set the color theme.
40    */
41    @FindBy(id = "${prefix}${name}")
42    private WebElement iconThemeInput;
43   
 
44  0 toggle public static ColorThemePropertyDisplayerPage gotoPage()
45    {
46  0 getUtil().gotoPage("XWiki", "ColorThemePropertyDisplayer");
47  0 return new ColorThemePropertyDisplayerPage();
48    }
49   
 
50  0 toggle private List<WebElement> getColorThemeOptions()
51    {
52  0 return iconThemeInput.findElements(By.tagName("option"));
53    }
54   
 
55  0 toggle private List<WebElement> getColibriThemeOptions()
56    {
57  0 return iconThemeInput.findElements(By.xpath("//optgroup[@label='Colibri Themes']//option"));
58    }
 
59  0 toggle private List<WebElement> getFlamingoThemeOptions()
60    {
61  0 return iconThemeInput.findElements(By.xpath("//optgroup[@label='Flamingo Themes']//option"));
62    }
63   
64    /**
65    * @return the list of available color themes
66    */
 
67  0 toggle public List<String> getColorThemes()
68    {
69  0 List<String> results = new ArrayList<>();
70  0 for (WebElement option : getColorThemeOptions()) {
71  0 results.add(option.getText());
72    }
73  0 return results;
74    }
75   
76    /**
77    * @return the list of colibri themes
78    */
 
79  0 toggle public List<String> getColibriColorThemes()
80    {
81  0 List<String> results = new ArrayList<>();
82  0 for (WebElement option : getColibriThemeOptions()) {
83  0 results.add(option.getText());
84    }
85  0 return results;
86    }
87   
88    /**
89    * @return the list of flamingo themes
90    */
 
91  0 toggle public List<String> getFlamingoThemes()
92    {
93  0 List<String> results = new ArrayList<>();
94  0 for (WebElement option : getFlamingoThemeOptions()) {
95  0 results.add(option.getText());
96    }
97  0 return results;
98    }
99    }