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

File GroupEditPage.java

 

Coverage histogram

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

Code metrics

2
13
5
1
93
47
6
0.46
2.6
5
1.2

Classes

Class Line # Actions
GroupEditPage 36 13 0% 6 0
1.0100%
 

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.WebElement;
24    import org.openqa.selenium.support.FindBy;
25    import org.xwiki.model.reference.DocumentReference;
26    import org.xwiki.test.ui.po.InlinePage;
27    import org.xwiki.test.ui.po.LiveTableElement;
28    import org.xwiki.test.ui.po.editor.UserPicker;
29   
30    /**
31    * Page Object for a Group page in Edit mode.
32    *
33    * @version $Id: ddea4f7956e639d4e5767ccfa85ae9eef30d24cd $
34    * @since 8.1M2
35    */
 
36    public class GroupEditPage extends InlinePage
37    {
38    LiveTableElement membersLiveTable = new LiveTableElement("groupusers");
39   
40    @FindBy(id = "addMembers")
41    private WebElement addMemberButton;
42   
43    @FindBy(id = "groupInput")
44    private WebElement groupInput;
45   
46    @FindBy(id = "userInput")
47    private WebElement userInput;
48   
 
49  2 toggle public void clickAddMemberButton()
50    {
51  2 this.addMemberButton.click();
52    }
53   
54    /**
55    * Method to add a new member (user or group) to a Group.
56    */
 
57  2 toggle public GroupEditPage addMemberToGroup(String member, boolean isUser)
58    {
59  2 UserPicker picker;
60   
61  2 if (isUser) {
62  1 picker = new UserPicker(userInput);
63    } else {
64  1 picker = new UserPicker(groupInput);
65    }
66   
67  2 picker.sendKeys(member).waitForSuggestions().select(member).waitForSuggestionsToDisappear();
68  2 clickAddMemberButton();
69   
70  2 waitForNotificationSuccessMessage("Members successfully added");
71   
72  2 return this;
73    }
74   
 
75  2 toggle public void filterMembers(String member)
76    {
77  2 membersLiveTable.filterColumn("xwiki-livetable-groupusers-filter-2", member);
78    }
79   
80    /**
81    * Method to go to a Group page in Edit mode.
82    */
 
83  1 toggle public static GroupEditPage gotoPage(DocumentReference groupReference)
84    {
85  1 getUtil().gotoPage(groupReference, "edit");
86  1 return new GroupEditPage();
87    }
88   
 
89  2 toggle public LiveTableElement getMembersTable()
90    {
91  2 return membersLiveTable;
92    }
93    }