Skip to content

Commit

Permalink
fix ariatemplates#961 Add timeout after focus or blur action, on some…
Browse files Browse the repository at this point in the history
… tests.

Fix theses tests on IE 11:

test.aria.widgets.form.multiselect.checkFeatures.MultiSelect
test.aria.widgets.form.multiselect.issue223.MultiSelect
test.aria.widgets.form.multiselect.issue312.AutoComplete
test.aria.widgets.form.multiselect.onblur.MultiSelect
test.aria.widgets.form.timefield.checkFormat.TimeField
test.aria.widgets.form.timefield.checkValue.TimeField
test.aria.widgets.form.passwordfield.PasswordField

Close ariatemplates#950
  • Loading branch information
fbasso authored and carlo-mr committed Mar 3, 2014
1 parent f527473 commit cc92dac
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 19 deletions.
10 changes: 8 additions & 2 deletions test/aria/widgets/form/multiselect/checkFeatures/MultiSelect.js
Expand Up @@ -40,8 +40,14 @@ Aria.classDefinition({

_onMSOpened : function () {
this.getInputField("ms1").blur();
this.assertTrue(this.getInputField("ms1").value == "Air France,Air Canada");
this.toggleMultiSelectOn("ms1", this._onIconClicked);
aria.core.Timer.addCallback({
fn : function() {
this.assertTrue(this.getInputField("ms1").value == "Air France,Air Canada");
this.toggleMultiSelectOn("ms1", this._onIconClicked);
},
scope : this,
delay : 25
});
},

_onIconClicked : function () {
Expand Down
23 changes: 17 additions & 6 deletions test/aria/widgets/form/multiselect/issue223/MultiSelect.js
Expand Up @@ -10,11 +10,16 @@ Aria.classDefinition({
runTemplateTest : function () {
this.assertTrue(this.getInputField("ms1").value === "");
this.getInputField("ms1").focus();
this.synEvent.type(this.getInputField("ms1"), "AF,AC,DL,AY", {
fn : this._afterTyping,
scope : this
aria.core.Timer.addCallback({
fn : function() {
this.synEvent.type(this.getInputField("ms1"), "AF,AC,DL,AY", {
fn : this._afterTyping,
scope : this
});
},
scope : this,
delay : 25
});

},

_afterTyping : function () {
Expand All @@ -29,8 +34,14 @@ Aria.classDefinition({

finishTest : function () {
this.getInputField("myTextField").focus();
this.assertTrue(this.getInputField("ms1").value === "AF,AC,DL");
this.end();
aria.core.Timer.addCallback({
fn : function() {
this.assertTrue(this.getInputField("ms1").value === "AF,AC,DL");
this.end();
},
scope : this,
delay : 25
});
}
}
});
8 changes: 7 additions & 1 deletion test/aria/widgets/form/multiselect/issue312/Common.js
Expand Up @@ -104,7 +104,13 @@ Aria.classDefinition({
};
var outerWidget = this.getWidgetInstance("widget");
outerWidget.focus();
outerWidget._toggleDropdown();
aria.core.Timer.addCallback({
fn : function() {
outerWidget._toggleDropdown();
},
scope : this,
delay : 25
});
},

_checkInnerSclassCb : function (args) {
Expand Down
12 changes: 9 additions & 3 deletions test/aria/widgets/form/multiselect/onblur/MultiSelect.js
Expand Up @@ -28,9 +28,15 @@ Aria.classDefinition({
runTemplateTest : function () {
this.assertTrue(this.getInputField("ms1").value === "");
this.getInputField("ms1").focus();
this.synEvent.type(this.getInputField("ms1"), "AF,AC,NZ,IB", {
fn : this._afterTyping,
scope : this
aria.core.Timer.addCallback({
fn : function() {
this.synEvent.type(this.getInputField("ms1"), "AF,AC,NZ,IB", {
fn : this._afterTyping,
scope : this
});
},
scope : this,
delay : 25
});

},
Expand Down
12 changes: 9 additions & 3 deletions test/aria/widgets/form/passwordfield/PasswordField.js
Expand Up @@ -45,9 +45,15 @@ Aria.classDefinition({

_afterFieldType : function () {
this.getInputField("pf").blur();
this.assertTrue(this.getInputField("tf").value == "abcd");
this.assertTrue(this.data.password == "abcd");
this.notifyTemplateTestEnd();
aria.core.Timer.addCallback({
fn : function() {
this.assertTrue(this.getInputField("tf").value == "abcd");
this.assertTrue(this.data.password == "abcd");
this.notifyTemplateTestEnd();
},
scope : this,
delay : 25
});

}
}
Expand Down
10 changes: 8 additions & 2 deletions test/aria/widgets/form/timefield/checkFormat/TimeField.js
Expand Up @@ -46,8 +46,14 @@ Aria.classDefinition({
var pm = aria.utils.Date.res.timeFormatLabels.pm;

myField.blur();
this.assertTrue(myField.value == "12:0:0 " + pm, "'12:0:0 PM' was expected in the timefield 1.");
this.notifyTemplateTestEnd();
aria.core.Timer.addCallback({
fn : function() {
this.assertTrue(myField.value == "12:0:0 " + pm, "'12:0:0 PM' was expected in the timefield 1.");
this.notifyTemplateTestEnd();
},
scope : this,
delay : 25
});
}
}

Expand Down
10 changes: 8 additions & 2 deletions test/aria/widgets/form/timefield/checkValue/TimeField.js
Expand Up @@ -45,8 +45,14 @@ Aria.classDefinition({
var myField = this.getInputField("tf1");

myField.blur();
this.assertTrue(myField.value === "00:00", "'00:00' was expected in the timefield.");
this.notifyTemplateTestEnd();
aria.core.Timer.addCallback({
fn : function() {
this.assertTrue(myField.value === "00:00", "'00:00' was expected in the timefield.");
this.notifyTemplateTestEnd();
},
scope : this,
delay : 25
});
}
}

Expand Down

0 comments on commit cc92dac

Please sign in to comment.