| 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 AccordionContainer A11Y Test</title> |
| 6 |
|
| 7 |
<style> |
| 8 |
@import "../../../../util/doh/robot/robot.css"; |
| 9 |
</style> |
| 10 |
|
| 11 |
|
| 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", "dojo/dom", "dojo/keys", |
| 18 |
"dijit/tests/helpers", "dojo/domReady!" |
| 19 |
], function(doh, robot, dom, keys, helpers){ |
| 20 |
|
| 21 |
robot.initRobot('../test_AccordionContainer.html'); |
| 22 |
|
| 23 |
var registry, focus; |
| 24 |
|
| 25 |
doh.register("setup", [ |
| 26 |
function setup(){ |
| 27 |
// get pointers to singletons loaded on test page |
| 28 |
registry = robot.window.require("dijit/registry"); |
| 29 |
focus = robot.window.require("dijit/focus"); |
| 30 |
} |
| 31 |
]); |
| 32 |
|
| 33 |
doh.register("Accordion A11Y tests", [ |
| 34 |
{ |
| 35 |
name: "basic operation", |
| 36 |
timeout: 10000, |
| 37 |
runTest: function(t){ |
| 38 |
var d = new doh.Deferred(); |
| 39 |
robot.sequence(function(){ |
| 40 |
dom.byId("beforeMarkupAccordion").focus(); |
| 41 |
}, 500, 500); |
| 42 |
|
| 43 |
// Tab into accordion, landing on title of first pane |
| 44 |
robot.keyPress(keys.TAB, 500, {}); |
| 45 |
robot.sequence(d.getTestErrback(function(){ |
| 46 |
doh.t(/A Simple Pane/.test(helpers.innerText(focus.curNode)), "tabbed to first pane's title"); |
| 47 |
}), 500); |
| 48 |
|
| 49 |
// Use down arrow to get to second pane's title |
| 50 |
robot.keyPress(keys.DOWN_ARROW, 500, {}); |
| 51 |
robot.sequence(d.getTestErrback(function(){ |
| 52 |
doh.f(/A Simple Pane/.test(helpers.innerText(focus.curNode)), "moved away from first pane's title"); |
| 53 |
doh.t(/Lazy Load Pane/.test(helpers.innerText(focus.curNode)), "moved to second pane's title"); |
| 54 |
doh.is("lazyLoadPane", registry.byId("markupAccordion").get("selectedChildWidget").id, "second pane is now selected"); |
| 55 |
}), 500); |
| 56 |
|
| 57 |
// Tab into second pane's content area, landing on link inside pane |
| 58 |
robot.keyPress(keys.TAB, 500, {}); |
| 59 |
robot.sequence(d.getTestErrback(function(){ |
| 60 |
doh.is("WebA11y", helpers.innerText(focus.curNode), "tabbed into second pane"); |
| 61 |
}), 500); |
| 62 |
|
| 63 |
// tab out of AccordionContainer |
| 64 |
robot.keyPress(keys.TAB, 500, {}); |
| 65 |
robot.sequence(d.getTestCallback(function(){ |
| 66 |
doh.is("afterMarkupAccordion", focus.curNode.id, "tabbed out of accordion"); |
| 67 |
}), 500); |
| 68 |
|
| 69 |
return d; |
| 70 |
} |
| 71 |
} |
| 72 |
]); |
| 73 |
|
| 74 |
doh.run(); |
| 75 |
}); |
| 76 |
</script> |
| 77 |
</head> |
| 78 |
</html> |