| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ConfirmDialog Widget Automated (non-robot) Tests</title> |
| 5 | |
| 6 | <script src="boilerplate.js"></script> |
| 7 | |
| 8 | <script type="text/javascript"> |
| 9 | require([ |
| 10 | "doh/runner", |
| 11 | "dojo/_base/declare", "dojo/dom", "dojo/dom-geometry", "dojo/dom-style", "dojo/window", |
| 12 | "dijit/focus", "dijit/registry", "dijit/ConfirmDialog", "dijit/DialogUnderlay", "dijit/_WidgetBase", |
| 13 | "dijit/tests/helpers", "dojo/domReady!" |
| 14 | ], function(doh, declare, dom, domGeom, domStyle, winUtils, |
| 15 | focus, registry, ConfirmDialog, DialogUnderlay, _WidgetBase, helpers){ |
| 16 | |
| 17 | doh.register("resize", [ |
| 18 | { |
| 19 | name: "create", |
| 20 | timeout: 10000, |
| 21 | runTest: function () { |
| 22 | // Create and show ConfirmDialog |
| 23 | dlg1 = new ConfirmDialog({ |
| 24 | id: "dlg1", |
| 25 | title: "ConfirmDialog 1", |
| 26 | content: "<input id='dlg1_inputA'><br>" + |
| 27 | "<input id='dlg1_inputB'><br>" + |
| 28 | "<input id='dlg1_inputC'><br>" + |
| 29 | "<input id='dlg1_inputD'><br>" + |
| 30 | "<input id='dlg1_inputE'><br>" + |
| 31 | "<input id='dlg1_inputF'><br>" + |
| 32 | "<input id='dlg1_inputG'><br>" + |
| 33 | "<input id='dlg1_inputH'><br>" |
| 34 | }); |
| 35 | |
| 36 | return dlg1.show().then(function() { |
| 37 | doh.t(helpers.isVisible(dlg1), "ConfirmDialog 1 is visible"); |
| 38 | }); |
| 39 | } |
| 40 | }, |
| 41 | |
| 42 | { |
| 43 | name: "resize", |
| 44 | timeout: 10000, |
| 45 | runTest: function(){ |
| 46 | dlg1.resize({h: 150, w: 300}); |
| 47 | |
| 48 | var domPos = domGeom.position(dlg1.domNode); |
| 49 | doh.is(150, domPos.h, "domNode.h"); |
| 50 | doh.is(300, domPos.w, "domNode.w"); |
| 51 | |
| 52 | // dialog should show title, containerNode, then finally actionBar |
| 53 | var titlePos = domGeom.position(dlg1.titleBar), |
| 54 | containerPos = domGeom.position(dlg1.containerNode), |
| 55 | actionBarPos = domGeom.position(dlg1.actionBarNode); |
| 56 | doh.t(Math.abs(titlePos.h + containerPos.h + actionBarPos.h - 148) < 1, "heights add up"); |
| 57 | doh.t(titlePos.h > 0, "title has height"); |
| 58 | doh.t(containerPos.h > 0, "container has height"); |
| 59 | doh.t(actionBarPos.h > 0, "container has height"); |
| 60 | |
| 61 | // and the containerNode should have a scroll bar |
| 62 | doh.is("auto", dlg1.containerNode.style.overflow, "overflow style"); |
| 63 | } |
| 64 | } |
| 65 | ]); |
| 66 | |
| 67 | doh.run(); |
| 68 | }); |
| 69 | </script> |
| 70 | </head> |
| 71 | <body> |
| 72 | <h1 class="testTitle">Dijit ConfirmDialog Automated (non-robot) tests</h1> |
| 73 | </body> |
| 74 | </html> |
| 75 | |
| 76 |