| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package org.xwiki.wiki.test.po; |
| 21 |
|
|
| 22 |
|
import org.openqa.selenium.WebElement; |
| 23 |
|
import org.openqa.selenium.support.FindBy; |
| 24 |
|
|
| 25 |
|
|
| 26 |
|
@since |
| 27 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 4 |
Complexity Density: 0.57 |
|
| 28 |
|
public class DeleteWikiPage extends ExtendedViewPage |
| 29 |
|
{ |
| 30 |
|
@FindBy(id = "confirmButton") |
| 31 |
|
private WebElement confirmButton; |
| 32 |
|
|
| 33 |
|
@FindBy(id = "wikiDeleteConfirmation") |
| 34 |
|
private WebElement wikiDeleteConfirmationInputField; |
| 35 |
|
|
| 36 |
|
@FindBy(xpath = "//*[@id=\"xwikicontent\"]/div[@class=\"box errormessage\"]") |
| 37 |
|
private WebElement errorMessage; |
| 38 |
|
|
| 39 |
|
@FindBy(xpath = "//*[@id=\"xwikicontent\"]/div[@class=\"box successmessage\"]") |
| 40 |
|
private WebElement successMessage; |
| 41 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 42 |
7 |
public DeleteWikiPage confirm(String wikiId)... |
| 43 |
|
{ |
| 44 |
7 |
wikiDeleteConfirmationInputField.clear(); |
| 45 |
7 |
wikiDeleteConfirmationInputField.sendKeys(wikiId); |
| 46 |
7 |
confirmButton.click(); |
| 47 |
7 |
return new DeleteWikiPage(); |
| 48 |
|
} |
| 49 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 50 |
3 |
public boolean hasSuccessMessage()... |
| 51 |
|
{ |
| 52 |
3 |
return successMessage.isDisplayed(); |
| 53 |
|
} |
| 54 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 55 |
4 |
public boolean hasUserErrorMessage()... |
| 56 |
|
{ |
| 57 |
4 |
return errorMessage.isDisplayed() && errorMessage.getText().contains("You must type in"); |
| 58 |
|
} |
| 59 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 60 |
4 |
public boolean hasWikiDeleteConfirmationInput(String value)... |
| 61 |
|
{ |
| 62 |
4 |
return value.equals(wikiDeleteConfirmationInputField.getAttribute("value")); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
} |