Debian Codegraph @

dijit/tests/layout/robot/GUI.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <title>robot GUI Test</title>
6
7 <style>
8 @import "../../../../util/doh/robot/robot.css";
9 </style>
10
11 <!-- required: dojo.js -->
12 <script type="text/javascript" src="../../../../dojo/dojo.js"
13 data-dojo-config="isDebug: true"></script>
14
15 <script type="text/javascript">
16 require([
17 "doh/runner", "dojo/robotx",
18 "dojo/dom",
19 "dijit/tests/helpers", "dijit/tests/layout/robot/borderContainerTestFunctions", "dojo/domReady!"
20 ], function(doh, robot, dom, helpers, bcTest){
21
22 robot.initRobot('../test_Gui.html');
23
24 var registry;
25
26 doh.register("setup", [
27 function setup(){
28 // get pointers to singletons loaded on test page
29 registry = robot.window.require("dijit/registry");
30 }
31 ]);
32
33 doh.register("API", [
34 function initialConditions(){
35 bcTest.checkBCpanes(registry.byId("main"), "main checkBCpanes"); // This test will fail in opera because it thinks that the center content is taller than the border container. However, it displays fine.
36 bcTest.checkBCpanes(registry.byId("mainSplit"), "mainSplit bcTest.checkBCpanes");
37 bcTest.checkBCpanes(registry.byId("embeddedBC"), "embeddedBC bcTest.checkBCpanes");
38 bcTest.checkBCpanes(registry.byId("bottomSplit"), "bottomSplit bcTest.checkBCpanes");
39 bcTest.checkInside(registry.byId("topTabs1"), registry.byId("centerSplit"), "topTabs1 inside centerSplit");
40 doh.t(helpers.isVisible(registry.byId("basicFormTab").domNode.parentNode), "basicFormTab visible");
41 }
42 ]);
43
44 doh.register("test_left_accordion", [
45 {
46 name: "open ac pane 2",
47 timeout: 4000,
48 runTest: function(t){
49 var d = new doh.Deferred();
50
51 robot.mouseMoveAt("ac_pane2_button", 500, 1);
52 robot.mouseClick({left:true}, 500);
53
54 robot.sequence(d.getTestCallback(function(){
55 doh.t(helpers.isHidden(registry.byId("ac_pane1").domNode), "pane1 hidden");
56 doh.t(helpers.isVisible(registry.byId("ac_pane2").domNode), "pane2 visible");
57 doh.t(helpers.isHidden(registry.byId("ac_pane3").domNode), "pane3 hidden");
58 }), 500);
59
60 return d;
61 }
62 }
63 ]);
64
65 doh.register("test_Top_Tab_Container", [
66 {
67 name: "open top tab 2",
68 timeout: 9000,
69 runTest: function(t){
70 var d = new doh.Deferred();
71
72 //Drag splitter to the left to make more room for the tab container
73 robot.mouseMoveAt("leftAccordion_splitter", 500, 1);
74 robot.mousePress({left: true}, 500);
75 robot.mouseMoveAt("leftAccordion_splitter", 500, 100, -100, 100);
76 robot.mouseRelease({left: true}, 500);
77
78 robot.mouseMoveAt("topTabs1_tablist_tabAccordion", 500, 1);
79 robot.mouseClick({left:true}, 500);
80 robot.mouseMoveAt("dijit_layout_ContentPane_2_button", 500, 1);
81 robot.mouseClick({left:true}, 500);
82
83 robot.sequence(d.getTestCallback(function(){
84 doh.t(helpers.isVisible(registry.byId("dijit_layout_ContentPane_2")), "Accordion tab 2 is not visible");
85 doh.t(helpers.isHidden(registry.byId("dijit_layout_ContentPane_4").domNode), "Accordion tab 4 is not hidden");
86 }), 1000);
87
88 return d;
89 }
90 },
91 {
92 name: "open top tab 3",
93 timeout: 9000,
94 runTest: function(t){
95 var d = new doh.Deferred();
96
97 robot.mouseMoveAt("topTabs1_tablist_textareaTab", 500, 1);
98 robot.mouseClick({left:true}, 500);
99 robot.mouseMoveAt("dijit_layout_ContentPane_6_button", 500, 1);
100 robot.mouseClick({left:true}, 500);
101
102 robot.sequence(d.getTestCallback(function(){
103 doh.t(helpers.isVisible(registry.byId("tabAccordionContainer").domNode), "Accordion container is not visible");
104 doh.t(helpers.isVisible(registry.byId("dijit_layout_ContentPane_6")), "Accordion tab 4 is not visible");
105 doh.t(helpers.isHidden(registry.byId("dijit_layout_ContentPane_7").domNode), "Accordion tab 3 is not hidden");
106 doh.t(helpers.isVisible(registry.byId("bbtab1").domNode), "Nested tab1 is not visible");
107 }), 1000);
108
109 return d;
110 }
111 },
112 {
113 name: "open top tab 3 and close nested tab",
114 timeout: 4000,
115 runTest: function(t){
116 var d = new doh.Deferred();
117
118 robot.mouseMoveAt(registry.byId("accTabs_tablist_bbtab3").closeNode, 500, 1);
119 robot.mouseClick({left:true}, 500);
120
121 robot.sequence(d.getTestCallback(function(){
122 doh.is(undefined, registry.byId("accTabs_tablist_bbtab3"), "accTabs_tablist_bbtab3 undefined");
123 }), 1000);
124
125 return d;
126 }
127 },
128 {
129 name: "open top tab 4",
130 timeout: 5000,
131 runTest: function(t){
132 var d = new doh.Deferred();
133
134 robot.mouseMoveAt("topTabs1_tablist_titlePaneCP", 500, 1);
135 robot.mouseClick({left:true}, 500);
136
137 robot.sequence(d.getTestCallback(function(){
138 var children = registry.byId("titlePaneCP").domNode.childNodes;
139 doh.is(3, children.length);
140 doh.t(helpers.isVisible(children[1].parentNode), "The title pane child node is not visible");
141 }), 1000);
142
143 return d;
144 }
145 },
146 {
147 name: "open top tab 4 and close title pane",
148 timeout: 4000,
149 runTest: function(t){
150 var d = new doh.Deferred();
151
152 robot.mouseMoveAt(registry.byId("tp").focusNode, 500, 1);
153 robot.mouseClick({left:true}, 500);
154
155 robot.sequence(d.getTestCallback(function(){
156 var titlePane = registry.byId("tp");
157 doh.f(titlePane.open);
158 doh.t(helpers.isHidden(dom.byId("tp_pane").parentNode), "Title pane is not hidden");
159 }), 1000);
160
161 return d;
162 }
163 },
164 {
165 name: "open top tab 5",
166 timeout: 5000,
167 runTest: function(t){
168 var d = new doh.Deferred();
169
170 robot.mouseMoveAt("topTabs1_tablist_tabContainerInTabCP", 500, 1);
171 robot.mouseClick({left:true}, 500);
172 robot.mouseMoveAt("tabContainerInTabCP_tablist_basicFormTab2", 500, 1);
173 robot.mouseClick({left:true}, 500);
174
175 robot.sequence(d.getTestCallback(function(){
176 doh.t(helpers.isVisible(registry.byId("basicFormTab2").domNode.parentNode), "The embedded tab content is not visible");
177 }), 1000);
178
179 return d;
180 }
181 },
182 {
183 name: "close top tab 5",
184 timeout: 4000,
185 runTest: function(t){
186 var d = new doh.Deferred();
187
188 robot.mouseMoveAt(registry.byId("topTabs1_tablist_tabContainerInTabCP").closeNode, 500, 1);
189 robot.mouseClick({left:true}, 500);
190
191 robot.sequence(d.getTestCallback(function(){
192 doh.is(undefined, registry.byId("topTabs1_tablist_tabContainerInTabCP"), "topTabs1_tablist_tabContainerInTabCP undefined");
193 }), 1000);
194
195 return d;
196 }
197 }
198 ]);
199
200 doh.register("test_Center_tab_containers", [
201 {
202 name: "open tab 2",
203 timeout: 10000,
204 runTest: function(t){
205 var d = new doh.Deferred();
206
207 //Drag splitter up to make more room for the tab container
208 robot.mouseMoveAt("topTabs1_splitter", 500, 1);
209 robot.mousePress({left: true}, 500);
210 robot.mouseMoveAt("topTabs1_splitter", 500, 100, 100, -200);
211 robot.mouseRelease({left: true}, 500);
212
213 robot.mouseMoveAt("bottomTabs1_tablist_btabB", 500, 1);
214 robot.mouseClick({left:true}, 500);
215
216 robot.sequence(d.getTestCallback(function(){
217 bcTest.checkInside(registry.byId("bottomTabs1"), registry.byId("embeddedBC"), "bottomTabs1 inside embeddedBC");
218 bcTest.checkInside(registry.byId("bottomTabs2"), registry.byId("embeddedBC"), "bottomTabs2 inside embeddedBC");
219 doh.t(helpers.isVisible(registry.byId("btabB").domNode), "Tab 2 is not visible");
220 doh.t(helpers.isHidden(registry.byId("btabA").domNode), "Tab 1 is not hidden");
221 }), 1000);
222
223 return d;
224 }
225 },
226 {
227 name: "close tab 3",
228 timeout: 4000,
229 runTest: function(t){
230 var d = new doh.Deferred();
231
232 robot.mouseMoveAt(registry.byId("bottomTabs1_tablist_btabC").closeNode, 500, 1);
233 robot.mouseClick({left:true}, 500);
234
235 robot.sequence(d.getTestCallback(function(){
236 doh.is(undefined, registry.byId("bottomTabs1_tablist_btabC"), "bottomTabs1_tablist_btabC undefined");
237 }), 1000);
238
239 return d;
240 }
241 }
242 ]);
243
244 doh.register("test_Bottom_tab_containers", [
245 {
246 name: "test1",
247 timeout: 5000,
248 runTest: function(t){
249 var d = new doh.Deferred();
250
251 //Drag splitter up to make more room for the tab container
252 robot.mouseMoveAt("bottomTabs_splitter", 500, 1);
253 robot.mousePress({left: true}, 500);
254 robot.mouseMoveAt("bottomTabs_splitter", 500, 100, 100, -200);
255 robot.mouseRelease({left: true}, 500);
256
257 robot.sequence(d.getTestCallback(function(){
258 doh.t(helpers.isVisible(registry.byId("dijit_layout_ContentPane_9").domNode), "dijit_layout_ContentPane_9 visible");
259 doh.t(helpers.isVisible(registry.byId("dijit_layout_ContentPane_9_splitter").domNode), "dijit_layout_ContentPane_9_splitter visible");
260 doh.t(helpers.isVisible(registry.byId("btabAA").domNode), "btabAA visible");
261 doh.t(helpers.isVisible(registry.byId("dijit_layout_ContentPane_10").domNode), "dijit_layout_ContentPane_10 visible");
262 doh.t(helpers.isVisible(registry.byId("dijit_layout_ContentPane_10_splitter").domNode), "dijit_layout_ContentPane_10_splitter visible");
263 }), 1000);
264
265 return d;
266 }
267 },
268 {
269 name: "test2",
270 timeout: 4000,
271 runTest: function(t){
272 var d = new doh.Deferred();
273
274 robot.mouseMoveAt("bottomTabs_tablist_btab2", 500, 1);
275 robot.mouseClick({left:true}, 500);
276
277 robot.sequence(d.getTestCallback(function(){
278 doh.t(helpers.isVisible(registry.byId("btab2").domNode), "btab2 visible");
279 doh.t(helpers.isHidden(registry.byId("dijit_layout_ContentPane_9").domNode), "dijit_layout_ContentPane_9 visible");
280 doh.t(helpers.isHidden(registry.byId("dijit_layout_ContentPane_9_splitter").domNode), "dijit_layout_ContentPane_9_splitter visible");
281 doh.t(helpers.isHidden(registry.byId("btabAA").domNode), "btabAA visible");
282 doh.t(helpers.isHidden(registry.byId("dijit_layout_ContentPane_10").domNode), "dijit_layout_ContentPane_10 visible");
283 doh.t(helpers.isHidden(registry.byId("dijit_layout_ContentPane_10_splitter").domNode), "dijit_layout_ContentPane_10_splitter visible");
284 }), 1000);
285
286 return d;
287 }
288 },
289 {
290 name: "test3",
291 timeout: 6000,
292 runTest: function(t){
293 var d = new doh.Deferred();
294
295 robot.mouseMoveAt(registry.byId("bottomTabs_tablist_btab3").closeNode, 500, 1);
296 robot.mouseClick({left:true}, 500);
297
298 robot.sequence(d.getTestCallback(function(){
299 doh.is(undefined, registry.byId("bottomTabs_tablist_btab3"), "bottomTabs_tablist_btab3 undefined");
300 }), 1000);
301
302 return d;
303 }
304 }
305 ]);
306
307 doh.run();
308 });
309 </script>
310 </head>
311 </html>