Error: doh._AssertFailure: assertEqual() failed:
expected
user
but got
tooltipDlg
ERROR IN:
function(){
var d = new doh.Deferred();
// Re-enable the ToolipDialog and ColorPalette drop down so that we can test it
registry.byId("toolbar1.dialog").set("disabled", false);
registry.byId("toolbar1.backcolor").set("disabled", false);
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
toolbar1Before.focus();
})), 500);
// Tab into toolbar and move to tooltip dialog button
robot.keyPress(keys.TAB, 500, {});
robot.keyPress(keys.RIGHT_ARROW, 500, {});
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.is("toolbar1.dialog", dfocus.curNode.id, "dialog button, first visit");
})), 1000);
// Open the dialog, focus should go to first input
robot.keyPress(keys.DOWN_ARROW, 500, {});
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.is("user", dfocus.curNode.id);
})), 1000);
// ESC should restore focus to toolbar dialog button
robot.keyPress(keys.ESCAPE, 500, {});
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.is("toolbar1.dialog", dfocus.curNode.id, "dialog button, second visit");
})), 1000);
// Open the dialog again
robot.keyPress(keys.DOWN_ARROW, 500, {});
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.is("user", dfocus.curNode.id, "user, again");
})), 1000);
// Submit should also restore focus to toolbar dialog button, assuming that it
// doesn't reset the focus somewhere else (like into the editor)
robot.keyPress(keys.TAB, 500);
robot.keyPress(keys.TAB, 500);
robot.keyPress(keys.ENTER, 500);
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.is("toolbar1.dialog", dfocus.curNode.id, "dialog button, third visit");
})), 1000);
// Try the ColorPalette
robot.keyPress(keys.RIGHT_ARROW, 500);
robot.keyPress(keys.DOWN_ARROW, 500);
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.t(dom.isDescendant(dfocus.curNode, registry.byId("toolbar1.colorPalette").domNode),
"focus inside colorpalette, actual focus is: " + (dfocus.curNode ?
(dfocus.curNode.id||"no id") : "no focus"));
})), 1000);
robot.keyPress(keys.RIGHT_ARROW, 500); // navigation in the ColorPalette
robot.keyPress(keys.DOWN_ARROW, 500); // navigation in the ColorPalette
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.t(dom.isDescendant(dfocus.curNode, registry.byId("toolbar1.colorPalette").domNode),
"focus still inside colorpalette, actual focus is: " + (dfocus.curNode ?
(dfocus.curNode.id||"no id") : "no focus"));
})), 1000);
// pressing tab in the colorpalette should move focus back to the toolbar
robot.keyPress(keys.TAB, 500);
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
doh.is("toolbar1.backcolor", dfocus.curNode.id, "back on colorpalette button");
})), 1000);
// try the ComboButton
robot.keyPress(keys.RIGHT_ARROW, 500);
robot.keyPress(keys.RIGHT_ARROW, 500);
robot.keyPress(keys.DOWN_ARROW, 500);
robot.sequence(d.getTestErrback(lang.hitch(this, function(){
// TODO: test that focus is on menu
})), 1000);
robot.keyPress(keys.SPACE, 500); // select first menu option
robot.sequence(d.getTestCallback(lang.hitch(this, function(){
// TODO: test that focus is returned to button
})), 1000);
return d;
}
FAILED test: ../../dijit/tests/robot/Toolbar.html::keyboard::drop downs 4053 ms
Can be seen in test_Toolbar.html. If you use the keyboard to get focus on the TooltipDialog button, and then press the down arrow, the TooltipDialog opens but the first field doesn't get focus. (Nothing seems to get focus.)