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.administration; |
21 |
|
|
22 |
|
import org.openqa.selenium.By; |
23 |
|
import org.xwiki.administration.test.po.LightBoxRegistrationPage; |
24 |
|
import org.xwiki.test.ui.po.AbstractRegistrationPage; |
25 |
|
import org.xwiki.test.ui.RegisterTest; |
26 |
|
import org.xwiki.test.ui.TestUtils; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 3 |
Complexity Density: 0.43 |
|
35 |
|
public class RegisterFromAdministrationTest extends RegisterTest |
36 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
37 |
7 |
@Override... |
38 |
|
protected void switchUser() |
39 |
|
{ |
40 |
7 |
getDriver().get(getUtil().getURLToLoginAsAdmin()); |
41 |
7 |
getUtil().recacheSecretToken(); |
42 |
7 |
getUtil().setDefaultCredentials(TestUtils.ADMIN_CREDENTIALS); |
43 |
|
} |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
8 |
@Override... |
46 |
|
protected AbstractRegistrationPage getRegistrationPage() |
47 |
|
{ |
48 |
8 |
return LightBoxRegistrationPage.gotoPage(); |
49 |
|
} |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
51 |
2 |
@Override... |
52 |
|
protected boolean tryToRegister() |
53 |
|
{ |
54 |
2 |
registrationPage.clickRegister(); |
55 |
|
|
56 |
2 |
getDriver().waitUntilElementsAreVisible( |
57 |
|
new By[] {By.xpath("//td[@class='username']/a[@href='/xwiki/bin/view/XWiki/JohnSmith']"), |
58 |
|
By.xpath("//dd/span[@class='LV_validation_message LV_invalid']") |
59 |
|
}, |
60 |
|
false |
61 |
|
); |
62 |
|
|
63 |
2 |
return !getDriver() |
64 |
|
.findElements( |
65 |
|
By.xpath("//td[@class='username']/a[@href='/xwiki/bin/view/XWiki/JohnSmith']")) |
66 |
|
.isEmpty(); |
67 |
|
} |
68 |
|
} |