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

File AdvancedSearchPane.java

 

Coverage histogram

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

Code metrics

0
11
6
1
118
45
6
0.55
1.83
6
1

Classes

Class Line # Actions
AdvancedSearchPane 33 11 0% 6 2
0.8823529588.2%
 

Contributing tests

This file is covered by 10 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.extension.test.po;
21   
22    import org.openqa.selenium.WebElement;
23    import org.openqa.selenium.support.FindBy;
24    import org.xwiki.extension.ExtensionId;
25    import org.xwiki.test.ui.po.BaseElement;
26   
27    /**
28    * Represents the advanced extension search form.
29    *
30    * @version $Id: 81d5212f3563053276043ef3c9ce5a4612d4ba95 $
31    * @since 4.2M1
32    */
 
33    public class AdvancedSearchPane extends BaseElement
34    {
35    /**
36    * The text input used to specify the extension ID.
37    */
38    @FindBy(id = "advancedExtensionSearch-id")
39    private WebElement idInput;
40   
41    /**
42    * The text input used to specify the extension version.
43    */
44    @FindBy(id = "advancedExtensionSearch-version")
45    private WebElement versionInput;
46   
47    /**
48    * The submit button.
49    */
50    @FindBy(xpath = "//*[@id = 'extension-search-advanced']//input[@type = 'submit']")
51    private WebElement searchButton;
52   
53    /**
54    * The cancel button.
55    */
56    @FindBy(xpath = "//*[@id = 'extension-search-advanced']//a[@href = '#extension-search-simple']")
57    private WebElement cancelButton;
58   
59    /**
60    * @return the text input used to specify the extension ID
61    */
 
62  1 toggle public WebElement getIdInput()
63    {
64  1 return idInput;
65    }
66   
67    /**
68    * @return the text input used to specify the extension version
69    */
 
70  2 toggle public WebElement getVersionInput()
71    {
72  2 return versionInput;
73    }
74   
75    /**
76    * @return the submit button
77    */
 
78  0 toggle public WebElement getSearchButton()
79    {
80  0 return searchButton;
81    }
82   
83    /**
84    * @return the cancel button
85    */
 
86  1 toggle public WebElement getCancelButton()
87    {
88  1 return cancelButton;
89    }
90   
91    /**
92    * Searches for the specified extension.
93    *
94    * @param extensionId the extension identifier
95    * @param extensionVersion the extension version
96    * @return the search results pane
97    */
 
98  12 toggle public SearchResultsPane search(CharSequence extensionId, CharSequence extensionVersion)
99    {
100  12 idInput.clear();
101  12 idInput.sendKeys(extensionId);
102  12 versionInput.clear();
103  12 versionInput.sendKeys(extensionVersion);
104  12 searchButton.click();
105  12 return new SearchResultsPane();
106    }
107   
108    /**
109    * Searches for the specified extension.
110    *
111    * @param extensionId the extension identifier
112    * @return the search results pane
113    */
 
114  7 toggle public SearchResultsPane search(ExtensionId extensionId)
115    {
116  7 return search(extensionId.getId(), extensionId.getVersion().getValue());
117    }
118    }