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; |
21 |
|
|
22 |
|
import org.junit.Assert; |
23 |
|
import org.junit.Rule; |
24 |
|
import org.junit.Test; |
25 |
|
import org.openqa.selenium.Keys; |
26 |
|
import org.xwiki.administration.test.po.AdministrationPage; |
27 |
|
import org.xwiki.test.ui.browser.IgnoreBrowser; |
28 |
|
import org.xwiki.test.ui.browser.IgnoreBrowsers; |
29 |
|
import org.xwiki.test.ui.po.ViewPage; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (45) |
Complexity: 1 |
Complexity Density: 0.02 |
|
37 |
|
public class KeyboardShortcutsTest extends AbstractTest |
38 |
|
{ |
39 |
|
@Rule |
40 |
|
public AdminAuthenticationRule adminAuthenticationRule = new AdminAuthenticationRule(getUtil()); |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (44) |
Complexity: 1 |
Complexity Density: 0.02 |
1PASS
|
|
42 |
1 |
@Test... |
43 |
|
@IgnoreBrowsers({ |
44 |
|
@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"), |
45 |
|
@IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177") |
46 |
|
}) |
47 |
|
public void testKeyboardShortcuts() |
48 |
|
{ |
49 |
1 |
ViewPage vp = getUtil().gotoPage("Sandbox", "WebHome"); |
50 |
|
|
51 |
|
|
52 |
1 |
vp.sendKeys("e"); |
53 |
|
|
54 |
|
|
55 |
1 |
vp.sendKeys(Keys.chord(Keys.ALT, "c")); |
56 |
1 |
vp.waitUntilPageIsLoaded(); |
57 |
1 |
Assert.assertTrue(getUtil().isInViewMode()); |
58 |
|
|
59 |
|
|
60 |
1 |
vp.sendKeys("k"); |
61 |
1 |
vp.waitUntilPageIsLoaded(); |
62 |
1 |
Assert.assertTrue(getUtil().isInWikiEditMode()); |
63 |
|
|
64 |
|
|
65 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
66 |
1 |
vp.sendKeys("g"); |
67 |
|
|
68 |
|
|
69 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
70 |
1 |
vp.sendKeys("f"); |
71 |
1 |
vp.waitUntilPageIsLoaded(); |
72 |
1 |
Assert.assertTrue(getUtil().isInInlineEditMode()); |
73 |
|
|
74 |
|
|
75 |
1 |
vp = getUtil().gotoPage("Sandbox", "TestPage1"); |
76 |
1 |
vp.sendKeys("r"); |
77 |
1 |
vp.waitUntilPageIsLoaded(); |
78 |
1 |
Assert.assertTrue(getUtil().isInRightsEditMode()); |
79 |
|
|
80 |
|
|
81 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
82 |
1 |
vp.sendKeys("r"); |
83 |
1 |
vp.waitUntilPageIsLoaded(); |
84 |
1 |
Assert.assertTrue(getUtil().isInAdminMode()); |
85 |
1 |
AdministrationPage administrationPage = new AdministrationPage(); |
86 |
1 |
Assert.assertTrue(administrationPage.hasSection("PageRights")); |
87 |
|
|
88 |
|
|
89 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
90 |
1 |
vp.sendKeys("o"); |
91 |
1 |
vp.waitUntilPageIsLoaded(); |
92 |
1 |
Assert.assertTrue(getUtil().isInObjectEditMode()); |
93 |
|
|
94 |
|
|
95 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
96 |
1 |
vp.sendKeys("s"); |
97 |
1 |
vp.waitUntilPageIsLoaded(); |
98 |
1 |
Assert.assertTrue(getUtil().isInClassEditMode()); |
99 |
|
|
100 |
|
|
101 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
102 |
1 |
vp.sendKeys(Keys.DELETE); |
103 |
1 |
vp.waitUntilPageIsLoaded(); |
104 |
1 |
Assert.assertTrue(getUtil().isInDeleteMode()); |
105 |
|
|
106 |
|
|
107 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
108 |
1 |
vp.sendKeys(Keys.F2); |
109 |
1 |
vp.waitUntilPageIsLoaded(); |
110 |
1 |
Assert.assertTrue(getUtil().isInRenameMode()); |
111 |
|
|
112 |
|
|
113 |
1 |
vp = getUtil().gotoPage("Sandbox", "WebHome"); |
114 |
1 |
vp.sendKeys("d"); |
115 |
1 |
vp.waitUntilPageIsLoaded(); |
116 |
1 |
Assert.assertTrue(getUtil().isInSourceViewMode()); |
117 |
|
} |
118 |
|
} |