1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.administration.test.po; |
21 |
|
|
22 |
|
import org.openqa.selenium.By; |
23 |
|
import org.openqa.selenium.WebElement; |
24 |
|
import org.openqa.selenium.support.FindBy; |
25 |
|
import org.xwiki.test.ui.po.ViewPage; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
@version |
31 |
|
@since |
32 |
|
|
|
|
| 88.2% |
Uncovered Elements: 2 (17) |
Complexity: 7 |
Complexity Density: 0.7 |
|
33 |
|
public class ResetPasswordPage extends ViewPage |
34 |
|
{ |
35 |
|
@FindBy(id = "u") |
36 |
|
private WebElement userNameInput; |
37 |
|
|
38 |
|
@FindBy(css = ".xcontent form input[type='submit']") |
39 |
|
private WebElement resetPasswordButton; |
40 |
|
|
41 |
|
@FindBy(css = ".xcontent .box") |
42 |
|
private WebElement messageBox; |
43 |
|
|
44 |
|
@FindBy(xpath = "//.[@class='xcontent']//a[contains(text(), 'Retry')]") |
45 |
|
private WebElement retryUserNameButton; |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
47 |
2 |
public static ResetPasswordPage gotoPage()... |
48 |
|
{ |
49 |
2 |
getUtil().gotoPage("XWiki", "ResetPassword"); |
50 |
2 |
return new ResetPasswordPage(); |
51 |
|
} |
52 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
53 |
0 |
public String getUserName()... |
54 |
|
{ |
55 |
0 |
return userNameInput.getAttribute("value"); |
56 |
|
} |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
3 |
public void setUserName(String userName)... |
59 |
|
{ |
60 |
3 |
this.userNameInput.sendKeys(userName); |
61 |
|
} |
62 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
63 |
3 |
public ResetPasswordPage clickResetPassword()... |
64 |
|
{ |
65 |
3 |
resetPasswordButton.click(); |
66 |
3 |
return new ResetPasswordPage(); |
67 |
|
} |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
3 |
public boolean isResetPasswordSent()... |
70 |
|
{ |
71 |
|
|
72 |
3 |
return !getDriver().hasElementWithoutWaiting(By.cssSelector(".xcontent form")) |
73 |
|
&& messageBox.getAttribute("class").contains("infomessage"); |
74 |
|
} |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
76 |
2 |
public String getMessage()... |
77 |
|
{ |
78 |
2 |
return messageBox.getText(); |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
81 |
1 |
public ResetPasswordPage clickRetry()... |
82 |
|
{ |
83 |
1 |
retryUserNameButton.click(); |
84 |
1 |
return new ResetPasswordPage(); |
85 |
|
} |
86 |
|
} |