| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package org.xwiki.extension.test.po; |
| 21 |
|
|
| 22 |
|
import org.openqa.selenium.Keys; |
| 23 |
|
import org.openqa.selenium.WebElement; |
| 24 |
|
import org.openqa.selenium.support.FindBy; |
| 25 |
|
import org.openqa.selenium.support.ui.Select; |
| 26 |
|
import org.xwiki.test.ui.po.BaseElement; |
| 27 |
|
import org.xwiki.test.ui.po.BasePage; |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
@version |
| 33 |
|
@since |
| 34 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 5 |
Complexity Density: 0.5 |
|
| 35 |
|
public class SimpleSearchPane extends BaseElement |
| 36 |
|
{ |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
@FindBy(id = "extensionSearchInput") |
| 41 |
|
private WebElement searchInput; |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
@FindBy(id = "extensionSearchRepositoryList") |
| 47 |
|
private WebElement repositorySelect; |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
@FindBy(linkText = "Advanced search") |
| 53 |
|
private WebElement advancedSearchLink; |
| 54 |
|
|
| 55 |
|
|
| 56 |
|
@return |
| 57 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 58 |
4 |
public WebElement getSearchInput()... |
| 59 |
|
{ |
| 60 |
4 |
return searchInput; |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
@return |
| 65 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 66 |
10 |
public Select getRepositorySelect()... |
| 67 |
|
{ |
| 68 |
10 |
return new Select(repositorySelect); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
@param |
| 75 |
|
@return |
| 76 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 77 |
5 |
public SearchResultsPane selectRepository(String repositoryId)... |
| 78 |
|
{ |
| 79 |
5 |
getRepositorySelect().selectByValue(repositoryId); |
| 80 |
5 |
new BasePage().waitUntilPageIsLoaded(); |
| 81 |
5 |
return new SearchResultsPane(); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 87 |
|
@return |
| 88 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 89 |
13 |
public AdvancedSearchPane clickAdvancedSearch()... |
| 90 |
|
{ |
| 91 |
13 |
advancedSearchLink.click(); |
| 92 |
13 |
return new AdvancedSearchPane(); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
|
| 96 |
|
|
| 97 |
|
|
| 98 |
|
@param |
| 99 |
|
@return |
| 100 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 101 |
13 |
public SearchResultsPane search(CharSequence keywords)... |
| 102 |
|
{ |
| 103 |
13 |
searchInput.clear(); |
| 104 |
13 |
searchInput.sendKeys(keywords, Keys.ENTER); |
| 105 |
13 |
return new SearchResultsPane(); |
| 106 |
|
} |
| 107 |
|
} |