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

File ApplicationsPanel.java

 

Coverage histogram

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

Code metrics

2
11
5
1
76
39
6
0.55
2.2
5
1.2

Classes

Class Line # Actions
ApplicationsPanel 35 11 0% 6 2
0.888888988.9%
 

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.panels.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.xwiki.test.ui.po.ViewPage;
28   
29    /**
30    * Represents actions for the Panels.Applications panel.
31    *
32    * @version $Id: f1ffb51b88e5eb50173a3fbf2e98d183c7aa9fff $
33    * @since 4.3M2
34    */
 
35    public class ApplicationsPanel extends ViewPage
36    {
37    /**
38    * @return the page representing the Application Panels page
39    */
 
40  9 toggle public static ApplicationsPanel gotoPage()
41    {
42  9 getUtil().gotoPage("Panels", "Applications");
43  9 return new ApplicationsPanel();
44    }
45   
 
46  0 toggle public static String getURL()
47    {
48  0 return getUtil().getURL("Panels", "Applications");
49    }
50   
 
51  1 toggle public boolean containsApplication(String applicationName)
52    {
53  1 return getDriver().findElementsWithoutWaiting(By.xpath(
54    "//a/span[@class=\"application-label\" and contains(text(), '" + applicationName + "')]")).size() == 1;
55    }
56   
 
57  5 toggle public ViewPage clickApplication(String applicationName)
58    {
59  5 getDriver().findElementWithoutWaiting(By.xpath(
60    "//a/span[@class=\"application-label\" and contains(text(), '" + applicationName + "')]")).click();
61  5 return new ViewPage();
62    }
63   
 
64  3 toggle public List<String> getApplications()
65    {
66  3 List<String> applications = new ArrayList<>();
67   
68  3 for (WebElement elem : getDriver().findElementsWithoutWaiting(By.cssSelector(".application-label"))) {
69  14 if (elem.isDisplayed()) {
70  11 applications.add(elem.getText());
71    }
72    }
73   
74  3 return applications;
75    }
76    }