1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.user.test.po; |
21 |
|
|
22 |
|
import org.openqa.selenium.WebElement; |
23 |
|
import org.openqa.selenium.support.FindBy; |
24 |
|
import org.xwiki.test.ui.po.BasePage; |
25 |
|
|
26 |
|
|
|
|
| 90.9% |
Uncovered Elements: 2 (22) |
Complexity: 7 |
Complexity Density: 0.47 |
|
27 |
|
public class ChangePasswordPage extends BasePage |
28 |
|
{ |
29 |
|
@FindBy(xpath = "//input[@id='xwikioriginalpassword']") |
30 |
|
private WebElement originalPassword; |
31 |
|
|
32 |
|
@FindBy(xpath = "//input[@id='xwikipassword']") |
33 |
|
private WebElement password1; |
34 |
|
|
35 |
|
@FindBy(xpath = "//input[@id='xwikipassword2']") |
36 |
|
private WebElement password2; |
37 |
|
|
38 |
|
@FindBy(xpath = "//input[@value='Save']") |
39 |
|
private WebElement changePassword; |
40 |
|
|
41 |
|
@FindBy(xpath = "//a[@class='secondary button']") |
42 |
|
private WebElement cancelPasswordChange; |
43 |
|
|
44 |
|
@FindBy(xpath = "//span[@class='box errormessage']") |
45 |
|
private WebElement errorMessage; |
46 |
|
|
47 |
|
@FindBy(xpath = "//span[@class='LV_validation_message LV_invalid']") |
48 |
|
private WebElement validationErrorMessage; |
49 |
|
|
50 |
|
@FindBy(xpath = "//span[@class='box infomessage']") |
51 |
|
private WebElement successMessage; |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
53 |
3 |
public void changePassword(String originalPassword, String password, String password2)... |
54 |
|
{ |
55 |
3 |
this.originalPassword.clear(); |
56 |
3 |
this.originalPassword.sendKeys(originalPassword); |
57 |
3 |
this.password1.clear(); |
58 |
3 |
this.password1.sendKeys(password); |
59 |
3 |
this.password2.clear(); |
60 |
3 |
this.password2.sendKeys(password2); |
61 |
|
} |
62 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
63 |
2 |
public void changePasswordAsAdmin(String password, String password2)... |
64 |
|
{ |
65 |
2 |
this.password1.clear(); |
66 |
2 |
this.password1.sendKeys(password); |
67 |
2 |
this.password2.clear(); |
68 |
2 |
this.password2.sendKeys(password2); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
1 |
public String getErrorMessage()... |
72 |
|
{ |
73 |
1 |
return errorMessage.getText(); |
74 |
|
} |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
76 |
3 |
public String getValidationErrorMessage()... |
77 |
|
{ |
78 |
3 |
return validationErrorMessage.getText(); |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
1 |
public String getSuccessMessage()... |
82 |
|
{ |
83 |
1 |
return successMessage.getText(); |
84 |
|
} |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
6 |
public void submit()... |
87 |
|
{ |
88 |
6 |
this.changePassword.click(); |
89 |
|
} |
90 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
91 |
0 |
public void cancel()... |
92 |
|
{ |
93 |
0 |
this.cancelPasswordChange.click(); |
94 |
|
} |
95 |
|
} |