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

File GroupsPage.java

 

Coverage histogram

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

Code metrics

0
19
7
1
108
55
7
0.37
2.71
7
1

Classes

Class Line # Actions
GroupsPage 35 19 0% 7 2
0.923076992.3%
 

Contributing tests

This file is covered by 1 test. .

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   
21    package org.xwiki.administration.test.po;
22   
23    import org.openqa.selenium.By;
24    import org.openqa.selenium.WebElement;
25    import org.openqa.selenium.support.FindBy;
26    import org.xwiki.test.ui.po.BasePage;
27    import org.xwiki.test.ui.po.LiveTableElement;
28   
29    /**
30    * Page Object for the Administration/Groups page.
31    *
32    * @version $Id: 8487fe8ae1a9ffe105e51e483e033c50e9273690 $
33    * @since 8.1M2
34    */
 
35    public class GroupsPage extends BasePage
36    {
37    LiveTableElement groupsLiveTable = new LiveTableElement("groupstable");
38   
39    @FindBy(id = "addNewGroup")
40    private WebElement addGroupButton;
41   
42    @FindBy(css = "#addnewgroup .button.create")
43    private WebElement createGroupButton;
44   
 
45  2 toggle public void clickAddNewGroupButton()
46    {
47  2 this.addGroupButton.click();
48    }
49   
 
50  2 toggle public void clickCreateGroupButton()
51    {
52  2 this.createGroupButton.click();
53    }
54   
55    /**
56    * Method to create a new Group.
57    */
 
58  2 toggle public GroupsPage addNewGroup(String groupName)
59    {
60  2 clickAddNewGroupButton();
61   
62    // TODO: create PO for the popup
63  2 getDriver().waitUntilElementIsVisible(By.id("newgroupi"));
64  2 getDriver().findElementWithoutWaiting(By.id("newgroupi")).sendKeys(groupName);
65  2 clickCreateGroupButton();
66  2 getDriver().waitUntilElementDisappears(By.id("lb"));
67   
68  2 GroupsPage groupsPage = new GroupsPage();
69  2 groupsPage.waitUntilPageIsLoaded();
70  2 return groupsPage;
71    }
72   
73    /**
74    * Method to go to the Administration/Groups page.
75    */
 
76  1 toggle public static GroupsPage gotoPage()
77    {
78  1 AdministrationPage.gotoPage().clickSection("Users & Groups", "Groups");
79  1 GroupsPage groupsPage = new GroupsPage();
80  1 groupsPage.waitUntilPageIsLoaded();
81  1 return groupsPage;
82    }
83   
84    /**
85    * Method that overrides waitUntilPageIsLoaded() and waits also for the Groups livetable to load.
86    *
87    * @see org.xwiki.test.ui.po.BasePage#waitUntilPageIsLoaded()
88    */
 
89  3 toggle @Override
90    public BasePage waitUntilPageIsLoaded()
91    {
92  3 super.waitUntilPageIsLoaded();
93   
94  3 groupsLiveTable.waitUntilReady();
95   
96  3 return this;
97    }
98   
 
99  2 toggle public LiveTableElement getGroupsTable()
100    {
101  2 return groupsLiveTable;
102    }
103   
 
104  0 toggle public void filterGroups(String group)
105    {
106  0 groupsLiveTable.filterColumn("name", group);
107    }
108    }