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.appwithinminutes; |
21 |
|
|
22 |
|
import java.util.HashMap; |
23 |
|
import java.util.Map; |
24 |
|
|
25 |
|
import org.apache.commons.lang3.RandomStringUtils; |
26 |
|
import org.junit.Assert; |
27 |
|
import org.junit.Before; |
28 |
|
import org.junit.Rule; |
29 |
|
import org.junit.Test; |
30 |
|
import org.xwiki.appwithinminutes.test.po.ApplicationHomeEditPage; |
31 |
|
import org.xwiki.appwithinminutes.test.po.ApplicationHomePage; |
32 |
|
import org.xwiki.appwithinminutes.test.po.EntryEditPage; |
33 |
|
import org.xwiki.appwithinminutes.test.po.EntryNamePane; |
34 |
|
import org.xwiki.test.ui.AbstractTest; |
35 |
|
import org.xwiki.test.ui.AdminAuthenticationRule; |
36 |
|
import org.xwiki.test.ui.browser.IgnoreBrowser; |
37 |
|
import org.xwiki.test.ui.browser.IgnoreBrowsers; |
38 |
|
import org.xwiki.test.ui.po.LiveTableElement; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
@version |
44 |
|
@since |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 2 |
Complexity Density: 0.11 |
|
46 |
|
public class AddEntryTest extends AbstractTest |
47 |
|
{ |
48 |
|
@Rule |
49 |
|
public AdminAuthenticationRule adminAuthenticationRule = new AdminAuthenticationRule(getUtil()); |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
private ApplicationHomePage homePage; |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
|
56 |
1 |
@Before... |
57 |
|
public void setUp() throws Exception |
58 |
|
{ |
59 |
1 |
getUtil().rest().deletePage(getTestClassName(), getTestMethodName()); |
60 |
1 |
Map<String, String> editQueryStringParameters = new HashMap<String, String>(); |
61 |
1 |
editQueryStringParameters.put("editor", "inline"); |
62 |
1 |
editQueryStringParameters.put("template", "AppWithinMinutes.LiveTableTemplate"); |
63 |
1 |
editQueryStringParameters.put("AppWithinMinutes.LiveTableClass_0_class", "Panels.PanelClass"); |
64 |
1 |
getUtil().gotoPage(getTestClassName(), getTestMethodName(), "edit", editQueryStringParameters); |
65 |
|
|
66 |
1 |
homePage = new ApplicationHomeEditPage().waitUntilPageIsLoaded().clickSaveAndView(); |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 1 |
Complexity Density: 0.09 |
1PASS
|
|
72 |
1 |
@Test... |
73 |
|
@IgnoreBrowsers({ |
74 |
|
@IgnoreBrowser(value = "internet.*", version = "8\\.*", reason="See http://jira.xwiki.org/browse/XE-1146"), |
75 |
|
@IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177") |
76 |
|
}) |
77 |
|
public void testEntryNameWithURLSpecialCharacters() |
78 |
|
{ |
79 |
1 |
EntryNamePane entryNamePane = homePage.clickAddNewEntry(); |
80 |
1 |
String entryName = "A?b=c&d#" + RandomStringUtils.randomAlphanumeric(3); |
81 |
1 |
entryNamePane.setName(entryName); |
82 |
1 |
EntryEditPage entryEditPage = entryNamePane.clickAdd(); |
83 |
1 |
entryEditPage.setValue("description", "This is a test panel."); |
84 |
1 |
entryEditPage.clickSaveAndView(); |
85 |
|
|
86 |
1 |
getUtil().gotoPage(getTestClassName(), getTestMethodName()); |
87 |
1 |
homePage = new ApplicationHomePage(); |
88 |
1 |
LiveTableElement entriesLiveTable = homePage.getEntriesLiveTable(); |
89 |
1 |
entriesLiveTable.waitUntilReady(); |
90 |
|
|
91 |
1 |
Assert.assertTrue(entriesLiveTable.hasRow("panel.livetable.doc.title", entryName)); |
92 |
|
} |
93 |
|
} |