1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.test.wysiwyg; |
21 |
|
|
22 |
|
import org.junit.Test; |
23 |
|
import org.openqa.selenium.Keys; |
24 |
|
import org.xwiki.test.wysiwyg.framework.AbstractWysiwygTestCase; |
25 |
|
|
26 |
|
import static org.junit.Assert.*; |
27 |
|
|
|
|
| 99.7% |
Uncovered Elements: 1 (316) |
Complexity: 37 |
Complexity Density: 0.13 |
|
28 |
|
public class StandardFeaturesTest extends AbstractWysiwygTestCase |
29 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
30 |
5 |
@Test... |
31 |
|
public void testEmptyWysiwyg() |
32 |
|
{ |
33 |
5 |
switchToSource(); |
34 |
5 |
assertSourceText(""); |
35 |
|
} |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
37 |
1 |
@Test... |
38 |
|
public void testTypingAndDeletion() |
39 |
|
{ |
40 |
1 |
String text = "az"; |
41 |
1 |
typeText(text); |
42 |
1 |
assertContent(text); |
43 |
1 |
typeBackspace(text.length()); |
44 |
1 |
testEmptyWysiwyg(); |
45 |
|
} |
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
47 |
1 |
@Test... |
48 |
|
public void testBold() |
49 |
|
{ |
50 |
1 |
typeText("x"); |
51 |
1 |
applyStyleTitle5(); |
52 |
1 |
selectAllContent(); |
53 |
1 |
clickBoldButton(); |
54 |
1 |
assertContent("<h5><strong>x</strong></h5>"); |
55 |
|
} |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
57 |
1 |
@Test... |
58 |
|
public void testItalics() |
59 |
|
{ |
60 |
1 |
typeText("x"); |
61 |
1 |
applyStyleTitle5(); |
62 |
1 |
selectAllContent(); |
63 |
1 |
clickItalicsButton(); |
64 |
1 |
assertContent("<h5><em>x</em></h5>"); |
65 |
|
} |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
67 |
1 |
@Test... |
68 |
|
public void testUnderline() |
69 |
|
{ |
70 |
1 |
typeText("x"); |
71 |
1 |
applyStyleTitle5(); |
72 |
1 |
selectAllContent(); |
73 |
1 |
clickUnderlineButton(); |
74 |
1 |
assertContent("<h5><ins>x</ins></h5>"); |
75 |
|
} |
76 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
77 |
1 |
@Test... |
78 |
|
public void testStrikethrough() |
79 |
|
{ |
80 |
1 |
typeText("x"); |
81 |
1 |
applyStyleTitle5(); |
82 |
1 |
selectAllContent(); |
83 |
1 |
clickStrikethroughButton(); |
84 |
1 |
assertContent("<h5><del>x</del></h5>"); |
85 |
|
} |
86 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
87 |
1 |
@Test... |
88 |
|
public void testSubscript() |
89 |
|
{ |
90 |
1 |
typeText("x"); |
91 |
1 |
applyStyleTitle5(); |
92 |
1 |
selectAllContent(); |
93 |
1 |
clickSubscriptButton(); |
94 |
1 |
assertContent("<h5><sub>x</sub></h5>"); |
95 |
|
} |
96 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
97 |
1 |
@Test... |
98 |
|
public void testSuperscript() |
99 |
|
{ |
100 |
1 |
typeText("x"); |
101 |
1 |
applyStyleTitle5(); |
102 |
1 |
selectAllContent(); |
103 |
1 |
clickSuperscriptButton(); |
104 |
1 |
assertContent("<h5><sup>x</sup></h5>"); |
105 |
|
} |
106 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
107 |
1 |
@Test... |
108 |
|
public void testUnorderedList() |
109 |
|
{ |
110 |
|
|
111 |
1 |
typeTextThenEnter("a"); |
112 |
1 |
typeTextThenEnter("b"); |
113 |
|
|
114 |
1 |
typeTextThenEnter("c"); |
115 |
|
|
116 |
1 |
typeBackspace(); |
117 |
1 |
selectAllContent(); |
118 |
1 |
clickUnorderedListButton(); |
119 |
1 |
assertContent("<ul><li>a</li><li>b</li><li>c</li></ul>"); |
120 |
|
|
121 |
|
|
122 |
1 |
clickUnorderedListButton(); |
123 |
1 |
assertContent("a<br>b<br>c"); |
124 |
|
|
125 |
|
|
126 |
1 |
resetContent(); |
127 |
1 |
typeText("a"); |
128 |
1 |
selectAllContent(); |
129 |
1 |
clickUnorderedListButton(); |
130 |
1 |
typeBackspace(2); |
131 |
1 |
testEmptyWysiwyg(); |
132 |
|
} |
133 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
134 |
1 |
@Test... |
135 |
|
public void testOrderedList() |
136 |
|
{ |
137 |
|
|
138 |
1 |
typeTextThenEnter("a"); |
139 |
1 |
typeTextThenEnter("b"); |
140 |
|
|
141 |
1 |
typeTextThenEnter("c"); |
142 |
|
|
143 |
1 |
typeBackspace(); |
144 |
1 |
selectAllContent(); |
145 |
1 |
clickOrderedListButton(); |
146 |
1 |
assertContent("<ol><li>a</li><li>b</li><li>c</li></ol>"); |
147 |
|
|
148 |
|
|
149 |
1 |
clickOrderedListButton(); |
150 |
1 |
assertContent("a<br>b<br>c"); |
151 |
|
|
152 |
|
|
153 |
1 |
resetContent(); |
154 |
1 |
typeText("a"); |
155 |
1 |
selectAllContent(); |
156 |
1 |
clickOrderedListButton(); |
157 |
1 |
typeBackspace(2); |
158 |
1 |
testEmptyWysiwyg(); |
159 |
|
} |
160 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
161 |
1 |
@Test... |
162 |
|
public void testStyle() |
163 |
|
{ |
164 |
1 |
typeText("x"); |
165 |
1 |
selectAllContent(); |
166 |
|
|
167 |
1 |
applyStyleTitle1(); |
168 |
1 |
assertContent("<h1>x</h1>"); |
169 |
|
|
170 |
1 |
applyStyleTitle2(); |
171 |
1 |
assertContent("<h2>x</h2>"); |
172 |
|
|
173 |
1 |
applyStyleTitle3(); |
174 |
1 |
assertContent("<h3>x</h3>"); |
175 |
|
|
176 |
1 |
applyStyleTitle4(); |
177 |
1 |
assertContent("<h4>x</h4>"); |
178 |
|
|
179 |
1 |
applyStyleTitle5(); |
180 |
1 |
assertContent("<h5>x</h5>"); |
181 |
|
|
182 |
1 |
applyStyleTitle6(); |
183 |
1 |
assertContent("<h6>x</h6>"); |
184 |
|
|
185 |
1 |
applyStylePlainText(); |
186 |
1 |
assertContent("<p>x</p>"); |
187 |
|
} |
188 |
|
|
189 |
|
|
190 |
|
@see |
191 |
|
|
192 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
193 |
1 |
@Test... |
194 |
|
public void testHR() |
195 |
|
{ |
196 |
1 |
clickHRButton(); |
197 |
|
|
198 |
1 |
applyStyleTitle1(); |
199 |
1 |
typeBackspace(); |
200 |
|
|
201 |
1 |
assertContent("<hr>"); |
202 |
|
|
203 |
|
|
204 |
1 |
typeBackspace(2); |
205 |
1 |
testEmptyWysiwyg(); |
206 |
1 |
switchToWysiwyg(); |
207 |
|
|
208 |
1 |
typeText("az"); |
209 |
1 |
applyStyleTitle1(); |
210 |
|
|
211 |
1 |
typeEnter(); |
212 |
1 |
typeBackspace(); |
213 |
|
|
214 |
1 |
moveCaret("document.body.firstChild.firstChild", 1); |
215 |
1 |
clickHRButton(); |
216 |
1 |
assertContent("<h1>a</h1><hr><h1>z</h1>"); |
217 |
|
} |
218 |
|
|
219 |
|
|
220 |
|
@see |
221 |
|
@see |
222 |
|
@see |
223 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
1PASS
|
|
224 |
1 |
@Test... |
225 |
|
public void testInsertSymbol() |
226 |
|
{ |
227 |
1 |
clickSymbolButton(); |
228 |
1 |
getSelenium().click("//div[@title='copyright sign']"); |
229 |
1 |
clickSymbolButton(); |
230 |
1 |
closeDialog(); |
231 |
1 |
clickSymbolButton(); |
232 |
1 |
getSelenium().click("//div[@title='registered sign']"); |
233 |
1 |
clickSymbolButton(); |
234 |
1 |
getSelenium().click("//div[@title='trade mark sign']"); |
235 |
1 |
switchToSource(); |
236 |
1 |
assertSourceText("\u00A9\u00AE\u2122"); |
237 |
|
} |
238 |
|
|
239 |
|
|
240 |
|
|
241 |
|
|
242 |
|
@see |
243 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
244 |
1 |
@Test... |
245 |
|
public void testTabDefault() |
246 |
|
{ |
247 |
1 |
typeText("a"); |
248 |
1 |
typeTab(); |
249 |
1 |
typeText("b"); |
250 |
1 |
typeShiftTab(); |
251 |
1 |
typeText("c"); |
252 |
1 |
assertContent("a bc"); |
253 |
|
} |
254 |
|
|
255 |
|
|
256 |
|
|
257 |
|
|
258 |
|
@see |
259 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
1PASS
|
|
260 |
1 |
@Test... |
261 |
|
public void testTabInListItem() |
262 |
|
{ |
263 |
1 |
typeText("x"); |
264 |
1 |
typeShiftEnter(); |
265 |
|
|
266 |
|
|
267 |
|
|
268 |
1 |
typeText("Y"); |
269 |
1 |
selectAllContent(); |
270 |
1 |
clickUnorderedListButton(); |
271 |
|
|
272 |
1 |
moveCaret("document.body.firstChild.childNodes[1].firstChild", 0); |
273 |
1 |
typeTab(); |
274 |
1 |
assertContent("<ul><li>x<ul><li>Y</li></ul></li></ul>"); |
275 |
1 |
typeShiftTab(); |
276 |
1 |
assertContent("<ul><li>x</li><li>Y</li></ul>"); |
277 |
|
} |
278 |
|
|
279 |
|
|
280 |
|
@see |
281 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
282 |
1 |
@Test... |
283 |
|
public void testEmptyLinesAreEditable() |
284 |
|
{ |
285 |
1 |
switchToSource(); |
286 |
1 |
setSourceText("a\n\n\n\nb"); |
287 |
1 |
switchToWysiwyg(); |
288 |
|
|
289 |
|
|
290 |
|
|
291 |
1 |
assertContent("<p>a</p><p><br></p><p><br></p><p>b</p>"); |
292 |
|
} |
293 |
|
|
294 |
|
|
295 |
|
@see |
296 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
297 |
1 |
@Test... |
298 |
|
public void testUnwantedBRsAreRemoved() |
299 |
|
{ |
300 |
1 |
typeText("a"); |
301 |
1 |
typeShiftEnter(); |
302 |
1 |
typeText("b"); |
303 |
1 |
typeShiftEnter(); |
304 |
1 |
switchToSource(); |
305 |
1 |
assertSourceText("a\nb\\\\"); |
306 |
|
} |
307 |
|
|
308 |
|
|
309 |
|
@see |
310 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
311 |
1 |
@Test... |
312 |
|
public void testPreview() |
313 |
|
{ |
314 |
1 |
typeText("x"); |
315 |
1 |
selectAllContent(); |
316 |
1 |
clickBoldButton(); |
317 |
1 |
clickEditPreview(); |
318 |
1 |
clickBackToEdit(); |
319 |
1 |
switchToSource(); |
320 |
1 |
assertSourceText("**x**"); |
321 |
|
} |
322 |
|
|
323 |
|
|
324 |
|
@see |
325 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
326 |
1 |
@Test... |
327 |
|
public void testInsertHRInPlaceOfASelectedList() |
328 |
|
{ |
329 |
1 |
typeTextThenEnter("a"); |
330 |
1 |
typeText("z"); |
331 |
1 |
selectAllContent(); |
332 |
1 |
clickUnorderedListButton(); |
333 |
1 |
clickHRButton(); |
334 |
1 |
switchToSource(); |
335 |
1 |
assertSourceText("----"); |
336 |
|
} |
337 |
|
|
338 |
|
|
339 |
|
@see |
340 |
|
|
341 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
342 |
1 |
@Test... |
343 |
|
public void testInsertHRInsideParagraph() |
344 |
|
{ |
345 |
|
|
346 |
|
|
347 |
|
|
348 |
1 |
typeText("xY"); |
349 |
1 |
applyStyleTitle1(); |
350 |
1 |
applyStylePlainText(); |
351 |
|
|
352 |
|
|
353 |
1 |
clickHRButton(); |
354 |
|
|
355 |
|
|
356 |
1 |
moveCaret("document.body.firstChild.firstChild", 1); |
357 |
|
|
358 |
|
|
359 |
1 |
clickHRButton(); |
360 |
|
|
361 |
|
|
362 |
1 |
moveCaret("document.body.firstChild.firstChild", 0); |
363 |
|
|
364 |
|
|
365 |
1 |
clickHRButton(); |
366 |
|
|
367 |
|
|
368 |
|
|
369 |
1 |
assertContent("<p><br></p><hr><p>x</p><hr><p>Y</p><hr><p><br></p>"); |
370 |
|
} |
371 |
|
|
372 |
|
|
373 |
|
@see |
374 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
375 |
1 |
@Test... |
376 |
|
public void testNewLinesAtTheEndOfListItemsArePreserved() |
377 |
|
{ |
378 |
1 |
String sourceText = "* \\\\\n** \\\\\n*** test1"; |
379 |
1 |
switchToSource(); |
380 |
1 |
setSourceText(sourceText); |
381 |
1 |
switchToWysiwyg(); |
382 |
1 |
switchToSource(); |
383 |
1 |
assertSourceText(sourceText); |
384 |
|
} |
385 |
|
|
386 |
|
|
387 |
|
@see |
388 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
389 |
1 |
@Test... |
390 |
|
public void testRemoveBoldStyleWhenTheStyleAttributeIsUsed() |
391 |
|
{ |
392 |
1 |
switchToSource(); |
393 |
1 |
setSourceText("hello (% style=\"font-family: monospace; font-weight: bold;\" %)vincent(%%) world"); |
394 |
1 |
switchToWysiwyg(); |
395 |
|
|
396 |
|
|
397 |
1 |
selectNodeContents("document.body.firstChild.childNodes[1]"); |
398 |
1 |
waitForBoldDetected(true); |
399 |
|
|
400 |
|
|
401 |
1 |
clickBoldButton(); |
402 |
1 |
waitForBoldDetected(false); |
403 |
|
|
404 |
|
|
405 |
1 |
switchToSource(); |
406 |
1 |
assertSourceText("hello (% style=\"font-family: monospace; font-weight: normal;\" %)vincent(%%) world"); |
407 |
|
} |
408 |
|
|
409 |
|
|
410 |
|
@see |
411 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
412 |
1 |
@Test... |
413 |
|
public void testRemoveBoldStyleWithinHeading() |
414 |
|
{ |
415 |
|
|
416 |
1 |
switchToSource(); |
417 |
1 |
setSourceText("(% style=\"font-weight: bold;\" %)\n= Title 1 ="); |
418 |
1 |
switchToWysiwyg(); |
419 |
|
|
420 |
|
|
421 |
1 |
select("document.body.firstChild.firstChild.firstChild", 3, "document.body.firstChild.firstChild.firstChild", 5); |
422 |
1 |
waitForBoldDetected(true); |
423 |
|
|
424 |
|
|
425 |
1 |
clickBoldButton(); |
426 |
1 |
waitForBoldDetected(false); |
427 |
|
|
428 |
|
|
429 |
1 |
switchToSource(); |
430 |
1 |
assertSourceText("(% style=\"font-weight: bold;\" %)\n= Tit(% style=\"font-weight: normal;\" %)le(%%) 1 ="); |
431 |
|
} |
432 |
|
|
433 |
|
|
434 |
|
@see |
435 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
436 |
1 |
@Test... |
437 |
|
public void testRemoveUnderlineStyleFromALink() |
438 |
|
{ |
439 |
|
|
440 |
1 |
switchToSource(); |
441 |
|
|
442 |
1 |
setSourceText("[[__foo__>>mailto:x@y.z||title=\"bar\"]]"); |
443 |
1 |
switchToWysiwyg(); |
444 |
|
|
445 |
|
|
446 |
1 |
selectNode("document.body.getElementsByTagName('a')[0]"); |
447 |
1 |
waitForUnderlineDetected(true); |
448 |
|
|
449 |
|
|
450 |
1 |
clickUnderlineButton(); |
451 |
1 |
waitForUnderlineDetected(false); |
452 |
|
|
453 |
|
|
454 |
1 |
switchToSource(); |
455 |
1 |
assertSourceText("[[foo>>mailto:x@y.z||title=\"bar\"]]"); |
456 |
|
} |
457 |
|
|
458 |
|
|
459 |
|
|
460 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
1PASS
|
|
461 |
1 |
@Test... |
462 |
|
public void testToolBarIsUpdatedOnLoad() |
463 |
|
{ |
464 |
1 |
clickEditPageInWikiSyntaxEditor(); |
465 |
1 |
setFieldValue("content", "**__abc__**"); |
466 |
1 |
clickEditPageInWysiwyg(); |
467 |
1 |
waitForEditorToLoad(); |
468 |
1 |
waitForBoldDetected(true); |
469 |
1 |
waitForUnderlineDetected(true); |
470 |
|
|
471 |
1 |
switchToSource(); |
472 |
1 |
setSourceText("**abc**"); |
473 |
1 |
switchToWysiwyg(); |
474 |
1 |
waitForBoldDetected(true); |
475 |
1 |
waitForUnderlineDetected(false); |
476 |
|
} |
477 |
|
|
478 |
|
|
479 |
|
@see |
480 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
481 |
1 |
@Test... |
482 |
|
public void testHTMLSpecialChars() |
483 |
|
{ |
484 |
1 |
typeText("<\"'&#'\">"); |
485 |
1 |
switchToSource(); |
486 |
1 |
assertSourceText("<\"'&#'\">"); |
487 |
|
|
488 |
|
|
489 |
1 |
setSourceText("<'\"&#\"'>"); |
490 |
1 |
switchToWysiwyg(); |
491 |
1 |
assertContent("<p><'\"&#\"'></p>"); |
492 |
|
|
493 |
1 |
applyStyleTitle1(); |
494 |
1 |
switchToSource(); |
495 |
1 |
assertSourceText("= <'\"&#\"'> ="); |
496 |
|
} |
497 |
|
|
498 |
|
|
499 |
|
@see |
500 |
|
|
|
|
| 94.1% |
Uncovered Elements: 1 (17) |
Complexity: 2 |
Complexity Density: 0.13 |
1PASS
|
|
501 |
1 |
@Test... |
502 |
|
public void testSectionEditing() |
503 |
|
{ |
504 |
|
|
505 |
1 |
String location = getSelenium().getLocation(); |
506 |
|
|
507 |
|
|
508 |
1 |
switchToSource(); |
509 |
1 |
setSourceText("= s1 =\n\nabc\n\n= s2 =\n\nxyz"); |
510 |
1 |
clickEditSaveAndView(); |
511 |
|
|
512 |
|
|
513 |
1 |
open(location + (location.indexOf('?') < 0 ? "?" : "") + "§ion=2"); |
514 |
1 |
waitForEditorToLoad(); |
515 |
1 |
typeDelete(2); |
516 |
1 |
typeText("c2"); |
517 |
1 |
switchToSource(); |
518 |
1 |
assertSourceText("= c2 =\n\nxyz"); |
519 |
1 |
clickEditSaveAndView(); |
520 |
|
|
521 |
|
|
522 |
1 |
open(location); |
523 |
1 |
waitForEditorToLoad(); |
524 |
1 |
switchToSource(); |
525 |
1 |
assertSourceText("= s1 =\n\nabc\n\n= c2 =\n\nxyz"); |
526 |
|
} |
527 |
|
|
528 |
|
|
529 |
|
@see |
530 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
531 |
1 |
@Test... |
532 |
|
public void testQuoteSyntaxIsEscaped() |
533 |
|
{ |
534 |
1 |
typeText("> 1"); |
535 |
1 |
switchToSource(); |
536 |
1 |
switchToWysiwyg(); |
537 |
1 |
assertEquals("> 1", getRichTextArea().getText()); |
538 |
|
} |
539 |
|
|
540 |
|
|
541 |
|
@see |
542 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
543 |
1 |
@Test... |
544 |
|
public void testRemoveItalicsFromDefinition() |
545 |
|
{ |
546 |
1 |
switchToSource(); |
547 |
|
|
548 |
1 |
setSourceText("(% style=\"font-style: italic;\" %)\n(((\n; term1\n: definition1\n:; term2\n:: definition2\n)))"); |
549 |
1 |
switchToWysiwyg(); |
550 |
1 |
selectNodeContents("document.getElementsByTagName('dd')[0].firstChild"); |
551 |
1 |
clickItalicsButton(); |
552 |
1 |
switchToSource(); |
553 |
1 |
assertSourceText("(% style=\"font-style: italic;\" %)\n(((\n; term1\n" |
554 |
|
+ ": (% style=\"font-style: normal;\" %)definition1(%%)\n:; term2\n:: definition2\n)))"); |
555 |
|
} |
556 |
|
|
557 |
|
|
558 |
|
@see |
559 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
560 |
1 |
@Test... |
561 |
|
public void testMultiLineVerbatimBlock() |
562 |
|
{ |
563 |
1 |
switchToSource(); |
564 |
1 |
String multiLineVerbatimBlock = "{{{a verbatim block\nwhich is multiline}}}"; |
565 |
1 |
setSourceText(multiLineVerbatimBlock); |
566 |
1 |
switchToWysiwyg(); |
567 |
1 |
switchToSource(); |
568 |
1 |
assertSourceText(multiLineVerbatimBlock); |
569 |
|
} |
570 |
|
|
571 |
|
|
572 |
|
@see |
573 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
574 |
1 |
@Test... |
575 |
|
public void testGroupStyleIsPreserved() |
576 |
|
{ |
577 |
1 |
switchToSource(); |
578 |
1 |
String styledGroup = "(% class=\"abc\" style=\"color: red;\" %)\n(((\ntext\n)))"; |
579 |
1 |
setSourceText(styledGroup); |
580 |
1 |
switchToWysiwyg(); |
581 |
1 |
switchToSource(); |
582 |
1 |
assertSourceText(styledGroup); |
583 |
|
} |
584 |
|
|
585 |
|
|
586 |
|
@see |
587 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
1PASS
|
|
588 |
1 |
@Test... |
589 |
|
public void testXWikiVarsAreDefined() |
590 |
|
{ |
591 |
1 |
switchToSource(); |
592 |
1 |
setSourceText("{{velocity}}#if($hasEdit)1#{else}2#end{{/velocity}}"); |
593 |
1 |
switchToWysiwyg(); |
594 |
1 |
assertEquals("1", getRichTextArea().getText()); |
595 |
|
} |
596 |
|
|
597 |
|
|
598 |
|
@see |
599 |
|
|
600 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
1PASS
|
|
601 |
1 |
@Test... |
602 |
|
public void testJavaScriptExtensionsAreNotIncludedInEditMode() |
603 |
|
{ |
604 |
|
|
605 |
1 |
typeText("x"); |
606 |
|
|
607 |
1 |
getRichTextArea().sendKeys(Keys.chord(Keys.CONTROL, "g")); |
608 |
|
|
609 |
1 |
switchToSource(); |
610 |
1 |
assertSourceText("x"); |
611 |
|
|
612 |
1 |
String jumpToPageTitleXPath = "//div[@class = 'xdialog-title' and starts-with(., 'Go to:')]"; |
613 |
1 |
assertElementNotPresent(jumpToPageTitleXPath); |
614 |
1 |
getSourceTextArea().sendKeys(Keys.chord(Keys.CONTROL, "g")); |
615 |
1 |
assertElementPresent(jumpToPageTitleXPath); |
616 |
|
|
617 |
|
|
618 |
|
|
619 |
|
|
620 |
|
|
621 |
|
|
622 |
1 |
getSourceTextArea().sendKeys(Keys.ESCAPE); |
623 |
1 |
switchToWysiwyg(); |
624 |
1 |
getRichTextArea().sendKeys(Keys.chord(Keys.CONTROL, "g"), Keys.ESCAPE); |
625 |
|
} |
626 |
|
|
627 |
|
|
628 |
|
@see |
629 |
|
@see |
630 |
|
|
631 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
632 |
1 |
@Test... |
633 |
|
public void testEditInFullScreen() |
634 |
|
{ |
635 |
1 |
typeText("abc"); |
636 |
|
|
637 |
1 |
select("document.body.firstChild", 1, "document.body.firstChild", 2); |
638 |
1 |
clickEditInFullScreen(); |
639 |
1 |
typeText("1"); |
640 |
1 |
clickExitFullScreen(); |
641 |
1 |
typeText("2"); |
642 |
1 |
switchToSource(); |
643 |
1 |
assertSourceText("a12c"); |
644 |
|
} |
645 |
|
|
646 |
|
|
647 |
|
@see |
648 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
649 |
1 |
@Test... |
650 |
|
public void testEditPageWithSpecialSymbolsInName() |
651 |
|
{ |
652 |
1 |
startCreatePage("Main", "#\"&\u00A7-_\\"); |
653 |
1 |
waitForEditorToLoad(); |
654 |
1 |
typeText("qzr"); |
655 |
1 |
clickEditPreview(); |
656 |
1 |
assertTextPresent("qzr"); |
657 |
|
} |
658 |
|
|
659 |
|
|
660 |
|
@see |
661 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
662 |
1 |
@Test... |
663 |
|
public void testNestedCustomInlineStyles() |
664 |
|
{ |
665 |
1 |
setContent("<p>ab<span style=\"color: red\">cd<span style=\"background-color: yellow\">ef</span>gh</span>" |
666 |
|
+ "ij<span style=\"font-family: monospace\">kl<span style=\"font-size: 24pt\">mn</span>op</span>rs</p>"); |
667 |
1 |
switchToSource(); |
668 |
1 |
assertEquals("ab(% style=\"color: red\" %)cd(% style=\"color: red; " |
669 |
|
+ "background-color: yellow\" %)ef(% style=\"color: red\" %)gh(%%)" |
670 |
|
+ "ij(% style=\"font-family: monospace\" %)kl(% style=\"font-family: monospace;" |
671 |
|
+ " font-size: 24pt\" %)mn(% style=\"font-family: monospace\" %)op(%%)rs", getSourceText()); |
672 |
|
} |
673 |
|
} |