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

File PreferencesEditPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

0
13
7
1
83
48
7
0.54
1.86
7
1

Classes

Class Line # Actions
PreferencesEditPage 28 13 0% 7 2
0.990%
 

Contributing tests

This file is covered by 2 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.user.test.po;
21   
22    import org.openqa.selenium.WebElement;
23    import org.openqa.selenium.support.FindBy;
24    import org.openqa.selenium.support.ui.Select;
25    import org.xwiki.test.ui.po.editor.EditPage;
26   
27    /** User profile, the preferences pane, edit mode. */
 
28    public class PreferencesEditPage extends EditPage
29    {
30    @FindBy(id = "XWiki.XWikiUsers_0_editor")
31    private WebElement defaultEditor;
32   
33    @FindBy(id = "XWiki.XWikiUsers_0_usertype")
34    private WebElement userType;
35   
36    @FindBy(id = "XWiki.XWikiUsers_0_timezone")
37    private WebElement timezone;
38   
 
39  1 toggle public void setSimpleUserType()
40    {
41  1 Select select = new Select(this.userType);
42  1 select.selectByIndex(1);
43    }
44   
 
45  1 toggle public void setAdvancedUserType()
46    {
47  1 Select select = new Select(this.userType);
48  1 select.selectByIndex(2);
49    }
50   
 
51  1 toggle public void setDefaultEditorDefault()
52    {
53  1 Select select = new Select(this.defaultEditor);
54  1 select.selectByIndex(0);
55    }
56   
 
57  1 toggle public void setDefaultEditorWysiwyg()
58    {
59  1 Select select = new Select(this.defaultEditor);
60  1 select.selectByIndex(2);
61    }
62   
 
63  1 toggle public void setDefaultEditorText()
64    {
65  1 Select select = new Select(this.defaultEditor);
66  1 select.selectByIndex(1);
67    }
68   
 
69  0 toggle public String getDefaultEditor()
70    {
71  0 return new Select(this.defaultEditor).getFirstSelectedOption().getText();
72    }
73   
 
74  1 toggle public void setTimezone(String value)
75    {
76    // See http://jira.xwiki.org/browse/XWIKI-8905
77    // When it's fixed use instead:
78    // Select select = new Select(this.timezone);
79    // select.selectByValue(value);
80  1 this.timezone.clear();
81  1 this.timezone.sendKeys(value);
82    }
83    }