Commit c46f69c0 c46f69c07cf61995496d8fe4a4f1005d204e9fc9 by Nicolas Perriault

fixed possible intermittent failure in form filling tests

1 parent 08c2c710
...@@ -125,14 +125,12 @@ casper.test.begin('nonexistent fields', 1, function(test) { ...@@ -125,14 +125,12 @@ casper.test.begin('nonexistent fields', 1, function(test) {
125 }); 125 });
126 }); 126 });
127 127
128 casper.test.begin('multiple forms', 2, function(test) { 128 casper.test.begin('multiple forms', 1, function(test) {
129 casper.start('tests/site/multiple-forms.html', function() { 129 casper.start('tests/site/multiple-forms.html', function() {
130 this.fill('form[name="f2"]', { 130 this.fill('form[name="f2"]', {
131 yo: "ok" 131 yo: "ok"
132 }, true); 132 }, true);
133 }).then(function() { 133 }).waitForUrl(/\?f=f2&yo=ok$/, function() {
134 test.assertUrlMatch(/\?f=f2&yo=ok$/, 'Casper.fill() handles multiple forms');
135 }).then(function() {
136 this.fill('form[name="f2"]', { 134 this.fill('form[name="f2"]', {
137 yo: "ok" 135 yo: "ok"
138 }); 136 });
...@@ -152,9 +150,8 @@ casper.test.begin('field array', 1, function(test) { ...@@ -152,9 +150,8 @@ casper.test.begin('field array', 1, function(test) {
152 'foo[bar]': "bar", 150 'foo[bar]': "bar",
153 'foo[baz]': "baz" 151 'foo[baz]': "baz"
154 }, true); 152 }, true);
155 }).then(function() { 153 }).waitForUrl("?foo[bar]=bar&foo[baz]=baz", function() {
156 test.assertUrlMatch('?foo[bar]=bar&foo[baz]=baz', 154 test.pass('Casper.fill() handles array syntax field names');
157 'Casper.fill() handles array syntax field names');
158 }).run(function() { 155 }).run(function() {
159 test.done(); 156 test.done();
160 }); 157 });
......