1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.index.test.po

File AllDocsPage.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart7.png
66% of files have more coverage

Code metrics

0
23
9
1
121
72
9
0.39
2.56
9
1

Classes

Class Line # Actions
AllDocsPage 35 23 0% 9 10
0.687568.8%
 

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.index.test.po;
21   
22    import org.openqa.selenium.By;
23    import org.openqa.selenium.WebElement;
24    import org.openqa.selenium.support.FindBy;
25    import org.xwiki.index.tree.test.po.DocumentTreeElement;
26    import org.xwiki.test.ui.po.LiveTableElement;
27    import org.xwiki.test.ui.po.ViewPage;
28   
29    /**
30    * Represents the actions possible on the AllDocs Page.
31    *
32    * @version $Id: b8ae47d32038a7fc88cb770fd4c34af1b05d9996 $
33    * @since 3.2M3
34    */
 
35    public class AllDocsPage extends ViewPage
36    {
37    @FindBy(xpath = "//li[@id='xwikiindex']/a")
38    private WebElement indexTab;
39   
40    @FindBy(xpath = "//li[@id='xwikitreeview']/a")
41    private WebElement treeTab;
42   
43    @FindBy(xpath = "//li[@id='xwikiattachments']/a")
44    private WebElement attachmentsTab;
45   
46    @FindBy(xpath = "//li[@id='xwikideletedDocs']/a")
47    private WebElement deletedDocsTab;
48   
49    @FindBy(xpath = "//li[@id='xwikideletedAttachments']/a")
50    private WebElement deletedAttachmentsTab;
51   
52    @FindBy(xpath = "//div[contains(@class, 'xwikitabpanescontainer')]/div")
53    private WebElement treeElement;
54   
 
55  5 toggle public static AllDocsPage gotoPage()
56    {
57  5 getUtil().gotoPage("Main", "AllDocs");
58  5 return new AllDocsPage();
59    }
60   
 
61  1 toggle public static String getURL()
62    {
63  1 return getUtil().getURL("Main", "AllDocs");
64    }
65   
 
66  3 toggle public LiveTableElement clickIndexTab()
67    {
68  3 this.indexTab.click();
69   
70  3 LiveTableElement lt = new LiveTableElement("alldocs");
71  3 lt.waitUntilReady();
72   
73  3 return lt;
74    }
75   
 
76  2 toggle public DocumentTreeElement clickTreeTab()
77    {
78  2 this.treeTab.click();
79  2 return new DocumentTreeElement(this.treeElement).waitForIt();
80    }
81   
 
82  1 toggle public LiveTableElement clickAttachmentsTab()
83    {
84  1 this.attachmentsTab.click();
85   
86  1 LiveTableElement lt = new LiveTableElement("allattachments");
87  1 lt.waitUntilReady();
88   
89  1 return lt;
90    }
91   
 
92  2 toggle public boolean hasDeletedDocsTab()
93    {
94  2 return getDriver().findElementsWithoutWaiting(By.xpath("//li[@id='xwikideletedDocs']/a")).size() > 0;
95    }
96   
 
97  2 toggle public boolean hasDeletedAttachmentsTab()
98    {
99  2 return getDriver().findElementsWithoutWaiting(By.xpath("//li[@id='xwikideletedAttachments']/a")).size() > 0;
100    }
101   
 
102  0 toggle public LiveTableElement clickDeletedDocsTab()
103    {
104  0 this.deletedDocsTab.click();
105   
106  0 LiveTableElement lt = new LiveTableElement("documentsTrash");
107  0 lt.waitUntilReady();
108   
109  0 return lt;
110    }
111   
 
112  0 toggle public LiveTableElement clickDeletedAttachmentsTab()
113    {
114  0 this.deletedAttachmentsTab.click();
115   
116  0 LiveTableElement lt = new LiveTableElement("attachmentTrash");
117  0 lt.waitUntilReady();
118   
119  0 return lt;
120    }
121    }