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.LoginPage; |
26 |
|
import org.xwiki.test.ui.po.ViewPage; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
|
|
|
| 70% |
Uncovered Elements: 6 (20) |
Complexity: 9 |
Complexity Density: 0.82 |
|
34 |
|
public class ResetPasswordCompletePage extends ViewPage |
35 |
|
{ |
36 |
|
@FindBy(css = ".xcontent .box") |
37 |
|
private WebElement messageBox; |
38 |
|
|
39 |
|
@FindBy(id = "p") |
40 |
|
private WebElement newPasswordField; |
41 |
|
|
42 |
|
@FindBy(id = "p2") |
43 |
|
private WebElement newPasswordConfirmationField; |
44 |
|
|
45 |
|
@FindBy(css = ".xcontent form input[type='submit']") |
46 |
|
private WebElement saveButton; |
47 |
|
|
48 |
|
@FindBy(xpath = "//.[@class='xcontent']//a[contains(@href, 'login')]") |
49 |
|
private WebElement loginButton; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
@return |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
1 |
public boolean isResetLinkValid()... |
57 |
|
{ |
58 |
|
|
59 |
1 |
return getDriver().hasElementWithoutWaiting(By.cssSelector(".xcontent form")); |
60 |
|
} |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0 |
public String getPassowrd()... |
63 |
|
{ |
64 |
0 |
return this.newPasswordField.getAttribute("value"); |
65 |
|
} |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
1 |
public void setPassword(String newPassword)... |
68 |
|
{ |
69 |
1 |
this.newPasswordField.sendKeys(newPassword); |
70 |
|
} |
71 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
0 |
public String getPasswordConfirmation()... |
73 |
|
{ |
74 |
0 |
return this.newPasswordConfirmationField.getAttribute("value"); |
75 |
|
} |
76 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
1 |
public void setPasswordConfirmation(String newPasswordConfirmation)... |
78 |
|
{ |
79 |
1 |
this.newPasswordConfirmationField.sendKeys(newPasswordConfirmation); |
80 |
|
} |
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
82 |
1 |
public ResetPasswordCompletePage clickSave()... |
83 |
|
{ |
84 |
1 |
saveButton.click(); |
85 |
1 |
return new ResetPasswordCompletePage(); |
86 |
|
} |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
1 |
public boolean isPasswordSuccessfullyReset()... |
89 |
|
{ |
90 |
|
|
91 |
1 |
return !getDriver().hasElementWithoutWaiting(By.cssSelector(".xcontent form")) |
92 |
|
&& messageBox.getAttribute("class").contains("infomessage"); |
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
0 |
public String getMessage()... |
96 |
|
{ |
97 |
0 |
return messageBox.getText(); |
98 |
|
} |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
100 |
1 |
public LoginPage clickLogin()... |
101 |
|
{ |
102 |
1 |
loginButton.click(); |
103 |
1 |
return new LoginPage(); |
104 |
|
} |
105 |
|
} |