1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.selenium; |
21 |
|
|
22 |
|
import org.junit.Test; |
23 |
|
import org.openqa.selenium.By; |
24 |
|
import org.xwiki.test.selenium.framework.AbstractXWikiTestCase; |
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
@version |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (68) |
Complexity: 7 |
Complexity Density: 0.11 |
|
31 |
|
public class DocExtraTest extends AbstractXWikiTestCase |
32 |
|
{ |
33 |
|
|
34 |
|
|
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
36 |
1 |
@Test... |
37 |
|
public void testDocExtraLoadingFromTabClicks() |
38 |
|
{ |
39 |
1 |
open("Main", "WebHome"); |
40 |
|
|
41 |
1 |
clickLinkWithXPath("//a[@id='Attachmentslink']", false); |
42 |
1 |
waitForDocExtraPaneActive("attachments"); |
43 |
|
|
44 |
1 |
clickLinkWithXPath("//a[@id='Historylink']", false); |
45 |
1 |
waitForDocExtraPaneActive("history"); |
46 |
|
|
47 |
1 |
clickLinkWithXPath("//a[@id='Informationlink']", false); |
48 |
1 |
waitForDocExtraPaneActive("information"); |
49 |
|
|
50 |
1 |
clickLinkWithXPath("//a[@id='Commentslink']", false); |
51 |
1 |
waitForDocExtraPaneActive("comments"); |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
@throws |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
60 |
1 |
@Test... |
61 |
|
public void testDocExtraLoadingFromKeyboardShortcuts() throws InterruptedException |
62 |
|
{ |
63 |
1 |
open("Main", "WebHome"); |
64 |
|
|
65 |
1 |
getSkinExecutor().pressKeyboardShortcut("a", false, false, false); |
66 |
1 |
waitForDocExtraPaneActive("attachments"); |
67 |
1 |
assertDocExtraPaneInView("attachments"); |
68 |
1 |
scrollToPageTop(); |
69 |
|
|
70 |
1 |
getSkinExecutor().pressKeyboardShortcut("h", false, false, false); |
71 |
1 |
waitForDocExtraPaneActive("history"); |
72 |
1 |
assertDocExtraPaneInView("history"); |
73 |
1 |
scrollToPageTop(); |
74 |
|
|
75 |
1 |
getSkinExecutor().pressKeyboardShortcut("i", false, false, false); |
76 |
1 |
waitForDocExtraPaneActive("information"); |
77 |
1 |
assertDocExtraPaneInView("information"); |
78 |
1 |
scrollToPageTop(); |
79 |
|
|
80 |
1 |
getSkinExecutor().pressKeyboardShortcut("c", false, false, false); |
81 |
1 |
waitForDocExtraPaneActive("comments"); |
82 |
1 |
assertDocExtraPaneInView("comments"); |
83 |
|
} |
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
89 |
1 |
@Test... |
90 |
|
public void testDocExtraLoadingFromURLAnchor() |
91 |
|
{ |
92 |
|
|
93 |
|
|
94 |
1 |
open("Main", "ThisPageDoesNotExist"); |
95 |
1 |
open("Main", "WebHome#Attachments"); |
96 |
1 |
waitForDocExtraPaneActive("attachments"); |
97 |
1 |
assertDocExtraPaneInView("attachments"); |
98 |
|
|
99 |
1 |
open("Main", "ThisPageDoesNotExist"); |
100 |
1 |
open("Main", "WebHome#History"); |
101 |
1 |
waitForDocExtraPaneActive("history"); |
102 |
1 |
assertDocExtraPaneInView("history"); |
103 |
|
|
104 |
1 |
open("Main", "ThisPageDoesNotExist"); |
105 |
1 |
open("Main", "WebHome#Information"); |
106 |
1 |
waitForDocExtraPaneActive("information"); |
107 |
1 |
assertDocExtraPaneInView("information"); |
108 |
|
|
109 |
1 |
open("Main", "ThisPageDoesNotExist"); |
110 |
1 |
open("Main", "WebHome#Comments"); |
111 |
1 |
waitForDocExtraPaneActive("comments"); |
112 |
1 |
assertDocExtraPaneInView("comments"); |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
120 |
1 |
@Test... |
121 |
|
public void testDocExtraLoadingFromLinks() |
122 |
|
{ |
123 |
1 |
open("Main", "WebHome"); |
124 |
|
|
125 |
1 |
clickShowAttachments(); |
126 |
1 |
waitForDocExtraPaneActive("attachments"); |
127 |
1 |
assertDocExtraPaneInView("attachments"); |
128 |
1 |
scrollToPageTop(); |
129 |
|
|
130 |
1 |
clickShowHistory(); |
131 |
1 |
waitForDocExtraPaneActive("history"); |
132 |
1 |
assertDocExtraPaneInView("history"); |
133 |
1 |
scrollToPageTop(); |
134 |
|
|
135 |
1 |
clickShowInformation(); |
136 |
1 |
waitForDocExtraPaneActive("information"); |
137 |
1 |
assertDocExtraPaneInView("information"); |
138 |
1 |
scrollToPageTop(); |
139 |
|
|
140 |
1 |
clickShowComments(); |
141 |
1 |
waitForDocExtraPaneActive("comments"); |
142 |
1 |
assertDocExtraPaneInView("comments"); |
143 |
|
} |
144 |
|
|
145 |
|
|
146 |
|
@param |
147 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
16 |
private void waitForDocExtraPaneActive(String paneId)... |
149 |
|
{ |
150 |
16 |
waitForElement(paneId + "content"); |
151 |
|
} |
152 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
153 |
6 |
private void scrollToPageTop()... |
154 |
|
{ |
155 |
6 |
getSelenium().getEval("window.scroll(0,0);"); |
156 |
|
} |
157 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
158 |
12 |
private void assertDocExtraPaneInView(String paneId)... |
159 |
|
{ |
160 |
12 |
String paneContentId = String.format("%scontent", paneId); |
161 |
12 |
assertElementInView(By.id(paneContentId)); |
162 |
|
} |
163 |
|
} |