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 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (77) |
Complexity: 5 |
Complexity Density: 0.07 |
|
26 |
|
public class PanelWizardTest extends AbstractXWikiTestCase |
27 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
28 |
4 |
@Override... |
29 |
|
public void setUp() |
30 |
|
{ |
31 |
4 |
super.setUp(); |
32 |
4 |
open("Panels", "PanelWizard"); |
33 |
|
} |
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
42 |
1 |
@Test... |
43 |
|
public void testSections() |
44 |
|
{ |
45 |
1 |
assertElementPresent("//a[text()='Page Layout']"); |
46 |
1 |
assertElementPresent("//a[text()='Panel List']"); |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (21) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
56 |
1 |
@Test... |
57 |
|
public void testPageLayout() |
58 |
|
{ |
59 |
1 |
clickLinkWithXPath("//a[@href='#PageLayoutSection']", false); |
60 |
|
|
61 |
1 |
clickLinkWithXPath("//div[@id='nosidecolumn']", false); |
62 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='rightPanels' and @style='display: none;']\")!=false;"); |
63 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='leftPanels' and @style='display: none;']\")!=false;"); |
64 |
1 |
assertElementPresent("//div[@id='rightPanels' and @style='display: none;']"); |
65 |
1 |
assertElementPresent("//div[@id='leftPanels' and @style='display: none;']"); |
66 |
1 |
clickLinkWithXPath("//div[@id='leftcolumn']", false); |
67 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='rightPanels' and @style='display: none;']\")!=false;"); |
68 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='leftPanels' and @style='display: block;']\")!=false;"); |
69 |
1 |
assertElementPresent("//div[@id='rightPanels' and @style='display: none;']"); |
70 |
1 |
assertElementPresent("//div[@id='leftPanels' and @style='display: block;']"); |
71 |
1 |
clickLinkWithXPath("//div[@id='rightcolumn']", false); |
72 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='rightPanels' and @style='display: block;']\")!=false;"); |
73 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='leftPanels' and @style='display: none;']\")!=false;"); |
74 |
1 |
assertElementPresent("//div[@id='rightPanels' and @style='display: block;']"); |
75 |
1 |
assertElementPresent("//div[@id='leftPanels' and @style='display: none;']"); |
76 |
1 |
clickLinkWithXPath("//div[@id='bothcolumns']", false); |
77 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='rightPanels' and @style='display: block;']\")!=false;"); |
78 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='leftPanels' and @style='display: block;']\")!=false;"); |
79 |
1 |
assertElementPresent("//div[@id='rightPanels' and @style='display: block;']"); |
80 |
1 |
assertElementPresent("//div[@id='leftPanels' and @style='display: block;']"); |
81 |
|
} |
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (23) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
91 |
1 |
@Test... |
92 |
|
public void testInsertQuickLinksPanelInLeftColumn() |
93 |
|
{ |
94 |
1 |
clickLinkWithXPath("//a[@href='#PageLayoutSection']", false); |
95 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='rightcolumn']\")!=false;"); |
96 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='bothcolumns']\")!=false;"); |
97 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='leftcolumn']\")!=false;"); |
98 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='nosidecolumn']\")!=false;"); |
99 |
1 |
clickLinkWithXPath("//div[@id='rightcolumn']", false); |
100 |
1 |
clickLinkWithXPath("//div[@id='bothcolumns']", false); |
101 |
1 |
waitForBodyContains("Page Layout"); |
102 |
1 |
waitForBodyContains("Panel List"); |
103 |
1 |
clickLinkWithXPath("//a[@href='#PanelListSection']", false); |
104 |
1 |
dragAndDrop(By.xpath("//div[@class='panel expanded QuickLinks']"), By.id("leftPanels")); |
105 |
1 |
dragAndDrop(By.xpath("//div[@class='panel expanded CategoriesPanel']"), By.id("rightPanels")); |
106 |
1 |
clickLinkWithXPath("//button[text()='Save the new layout']", false); |
107 |
1 |
waitForNotificationSuccessMessage("The layout has been saved properly."); |
108 |
1 |
open("Panels", "PanelWizard"); |
109 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@class='panel expanded QuickLinks']\")!=false;"); |
110 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@class='panel expanded Backlinks']\")!=false;"); |
111 |
1 |
waitForCondition("selenium.isElementPresent(\"leftPanels\")!=false;"); |
112 |
1 |
waitForCondition("selenium.isElementPresent(\"rightPanels\")!=false;"); |
113 |
1 |
assertElementPresent("//div[@class='panel expanded QuickLinks']"); |
114 |
1 |
assertElementPresent("//div[@class='panel expanded CategoriesPanel']"); |
115 |
1 |
assertElementPresent("leftPanels"); |
116 |
1 |
assertElementPresent("rightPanels"); |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (24) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
126 |
1 |
@Test... |
127 |
|
public void testButtons() |
128 |
|
{ |
129 |
|
|
130 |
1 |
waitForBodyContains("Go to Panels home page"); |
131 |
1 |
assertElementPresent("//a[text()='Page Layout']"); |
132 |
1 |
assertElementPresent("//a[text()='Panel List']"); |
133 |
1 |
clickLinkWithText("Go to Panels home page"); |
134 |
|
|
135 |
|
|
136 |
1 |
open("Panels", "PanelWizard"); |
137 |
1 |
clickLinkWithXPath("//a[@href='#PageLayoutSection']", false); |
138 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='rightcolumn']\")!=false;"); |
139 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='bothcolumns']\")!=false;"); |
140 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='leftcolumn']\")!=false;"); |
141 |
1 |
waitForCondition("selenium.isElementPresent(\"//div[@id='nosidecolumn']\")!=false;"); |
142 |
1 |
clickLinkWithXPath("//div[@id='leftcolumn']", false); |
143 |
1 |
clickLinkWithXPath("//a[@href='#PanelListSection']", false); |
144 |
1 |
waitForCondition("selenium.isElementPresent(\"//button[text()='Revert']\")!=false;"); |
145 |
1 |
dragAndDrop(By.xpath("//div[@class = 'panel expanded QuickLinks']"), By.id("leftPanels")); |
146 |
1 |
getSelenium().click("revertLayout"); |
147 |
|
|
148 |
|
|
149 |
1 |
waitForCondition("selenium.isElementPresent(\"//a[text()='Panel Wizard']\")!=false;"); |
150 |
1 |
clickLinkWithXPath("//a[text()='Panel Wizard']", true); |
151 |
1 |
waitForBodyContains("Page Layout"); |
152 |
1 |
waitForBodyContains("Panel List"); |
153 |
1 |
assertElementPresent("//a[text()='Page Layout']"); |
154 |
1 |
assertElementPresent("//a[text()='Panel List']"); |
155 |
1 |
waitForCondition("selenium.isElementPresent(\"//button[text()='Save the new layout']\")!=false;"); |
156 |
1 |
clickLinkWithXPath("//button[text()='Save the new layout']", false); |
157 |
1 |
waitForNotificationSuccessMessage("The layout has been saved properly."); |
158 |
|
} |
159 |
|
} |