| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package org.xwiki.test.ui.po; |
| 21 |
|
|
| 22 |
|
import org.openqa.selenium.By; |
| 23 |
|
import org.openqa.selenium.WebElement; |
| 24 |
|
import org.openqa.selenium.support.FindBy; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
@version |
| 30 |
|
@since |
| 31 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 6 |
Complexity Density: 0.86 |
|
| 32 |
|
public class DeletingPage extends ViewPage |
| 33 |
|
{ |
| 34 |
|
private static final String SUCCESS_MESSAGE_ID = "successMessage"; |
| 35 |
|
|
| 36 |
|
private static final String ERROR_MESSAGE_ID = "errorMessage"; |
| 37 |
|
|
| 38 |
|
private static final String PROGRESS_BAR_CONTAINER_ID = "delete-progress-bar-container"; |
| 39 |
|
|
| 40 |
|
@FindBy(id = SUCCESS_MESSAGE_ID) |
| 41 |
|
private WebElement successMessage; |
| 42 |
|
|
| 43 |
|
@FindBy(id = ERROR_MESSAGE_ID) |
| 44 |
|
private WebElement errorMessage; |
| 45 |
|
|
| 46 |
|
@FindBy(id = PROGRESS_BAR_CONTAINER_ID) |
| 47 |
|
private WebElement progressBarContainer; |
| 48 |
|
|
| 49 |
|
@FindBy(xpath = "//div[@id = 'document-title']//a") |
| 50 |
|
private WebElement titleLink; |
| 51 |
|
|
| 52 |
|
|
| 53 |
|
@return |
| 54 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 55 |
1 |
public boolean isTerminated()... |
| 56 |
|
{ |
| 57 |
1 |
return !progressBarContainer.isDisplayed(); |
| 58 |
|
} |
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
| 62 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 63 |
7 |
public void waitUntilIsTerminated()... |
| 64 |
|
{ |
| 65 |
7 |
getDriver().waitUntilElementDisappears(By.id(PROGRESS_BAR_CONTAINER_ID)); |
| 66 |
|
} |
| 67 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 68 |
1 |
public boolean isSuccess()... |
| 69 |
|
{ |
| 70 |
1 |
return successMessage.isDisplayed(); |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 75 |
|
@since |
| 76 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 77 |
2 |
public void waitUntilSuccessMessage()... |
| 78 |
|
{ |
| 79 |
2 |
getDriver().waitUntilElementIsVisible(By.id(SUCCESS_MESSAGE_ID)); |
| 80 |
|
} |
| 81 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 82 |
2 |
public String getSuccessMessage()... |
| 83 |
|
{ |
| 84 |
2 |
return successMessage.getText(); |
| 85 |
|
} |
| 86 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 87 |
4 |
public DeletePageOutcomePage getDeletePageOutcomePage()... |
| 88 |
|
{ |
| 89 |
|
|
| 90 |
4 |
titleLink.click(); |
| 91 |
|
|
| 92 |
4 |
return new DeletePageOutcomePage(); |
| 93 |
|
} |
| 94 |
|
} |