1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.wiki.test.po; |
21 |
|
|
22 |
|
import org.openqa.selenium.By; |
23 |
|
import org.openqa.selenium.WebElement; |
24 |
|
import org.openqa.selenium.support.FindBy; |
25 |
|
|
|
|
| 57.9% |
Uncovered Elements: 8 (19) |
Complexity: 8 |
Complexity Density: 0.73 |
|
26 |
|
public class WikiCreationPage extends ExtendedViewPage |
27 |
|
{ |
28 |
|
@FindBy(id = "finalize") |
29 |
|
private WebElement finalizeButton; |
30 |
|
|
31 |
|
@FindBy(xpath = "//div[@class='wizard-header']/h1/span") |
32 |
|
private WebElement stepTitle; |
33 |
|
|
34 |
|
@FindBy(id = "creation-log") |
35 |
|
private WebElement log; |
36 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
37 |
0 |
public static String getSpace()... |
38 |
|
{ |
39 |
0 |
return "WikiManager"; |
40 |
|
} |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
42 |
0 |
public static String getPage()... |
43 |
|
{ |
44 |
0 |
return "CreateNewWiki"; |
45 |
|
} |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
47 |
3 |
public WikiHomePage finalizeCreation()... |
48 |
|
{ |
49 |
|
|
50 |
3 |
getDriver().waitUntilElementIsVisible(By.id("finalize"), 30); |
51 |
|
|
52 |
3 |
finalizeButton.click(); |
53 |
|
|
54 |
3 |
waitUntilPageIsLoaded(); |
55 |
|
|
56 |
3 |
return new WikiHomePage(); |
57 |
|
} |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
3 |
public String getStepTitle()... |
60 |
|
{ |
61 |
3 |
return stepTitle.getText(); |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
0 |
public boolean isFinalizeButtonEnabled()... |
65 |
|
{ |
66 |
0 |
return finalizeButton.isEnabled(); |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
0 |
public boolean isFinalizeButtonVisible()... |
70 |
|
{ |
71 |
0 |
return finalizeButton.isDisplayed(); |
72 |
|
} |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
2 |
public void waitForFinalizeButton(int timeout)... |
75 |
|
{ |
76 |
|
|
77 |
2 |
getDriver().waitUntilElementIsVisible(By.id("finalize"), timeout); |
78 |
|
} |
79 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
3 |
public boolean hasLogError()... |
81 |
|
{ |
82 |
3 |
return !getDriver().findElementsWithoutWaiting( |
83 |
|
By.xpath("div[@id='creation-log']//li[contains(@class, 'log-item-error')]")).isEmpty(); |
84 |
|
} |
85 |
|
} |