1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.linkchecker.test.ui; |
21 |
|
|
22 |
|
import org.junit.Test; |
23 |
|
import org.openqa.selenium.WebDriver; |
24 |
|
import org.openqa.selenium.support.ui.ExpectedCondition; |
25 |
|
import org.xwiki.linkchecker.test.po.LinkCheckerAllDocsPage; |
26 |
|
import org.xwiki.test.ui.AbstractTest; |
27 |
|
import org.xwiki.test.ui.po.LiveTableElement; |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@version |
33 |
|
@since |
34 |
|
|
|
|
| 83.3% |
Uncovered Elements: 2 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
35 |
|
public class LinkCheckerTest extends AbstractTest |
36 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
37 |
1 |
@Test... |
38 |
|
public void testLinkChecker() |
39 |
|
{ |
40 |
1 |
getUtil().deletePage(getClass().getSimpleName(), getTestMethodName()); |
41 |
|
|
42 |
|
|
43 |
1 |
getUtil().createPage(getClass().getSimpleName(), getTestMethodName(), "http://doesntexist", getTestClassName()); |
44 |
|
|
45 |
|
|
46 |
1 |
final LinkCheckerAllDocsPage page = LinkCheckerAllDocsPage.gotoPage(); |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
1 |
getDriver().waitUntilCondition(new ExpectedCondition<Boolean>() |
51 |
|
{ |
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
52 |
1 |
public Boolean apply(WebDriver driver)... |
53 |
|
{ |
54 |
1 |
LiveTableElement livetable = page.clickLinkCheckerTab(); |
55 |
1 |
if (livetable.hasRow("Link", "http://doesntexist")) { |
56 |
1 |
return true; |
57 |
|
} else { |
58 |
0 |
return false; |
59 |
|
} |
60 |
|
} |
61 |
|
}); |
62 |
|
} |
63 |
|
} |