|
130 | 130 | it('Should click, blur on Remote input and error message should display', function () {
|
131 | 131 | var elmInput = $('[name=input1]');
|
132 | 132 | elmInput.click();
|
| 133 | + element(by.css('body')).click(); |
133 | 134 | elmInput.sendKeys(protractor.Key.TAB);
|
134 | 135 | //$('[for=input1]').click();
|
135 | 136 | browser.waitForAngular();
|
|
143 | 144 | var elmInput = $('[name=input1]');
|
144 | 145 | elmInput.click();
|
145 | 146 | elmInput.sendKeys('ab');
|
| 147 | + element(by.css('body')).click(); |
146 | 148 | elmInput.sendKeys(protractor.Key.TAB);
|
147 | 149 | //$('[for=input1]').click();
|
148 | 150 | browser.sleep(1100); // sleep because of our data sample having a delay of 1sec internally, we use 1.5sec on this side to be sure
|
|
155 | 157 | var elmInput = $('[name=input1]');
|
156 | 158 | elmInput.clear().then(function() {
|
157 | 159 | elmInput.sendKeys('abc');
|
| 160 | + element(by.css('body')).click(); |
158 | 161 | elmInput.sendKeys(protractor.Key.TAB);
|
159 | 162 | //$('[for=input1]').click();
|
160 | 163 | browser.sleep(1100); // sleep because of our data sample having a delay of 1sec internally, we use 1.5sec on this side to be sure
|
|
172 | 175 | }
|
173 | 176 | var elmInput = $('[name=' + formElementNames[i] + ']');
|
174 | 177 | elmInput.click();
|
| 178 | + element(by.css('body')).click(); |
175 | 179 | elmInput.sendKeys(protractor.Key.TAB);
|
176 | 180 | //$('[for=' + formElementNames[i] + ']').click(); // click on label to blur away
|
177 | 181 |
|
178 | 182 | if (formElementNames[i] === 'select1') {
|
179 | 183 | element(by.cssContainingText('option', 'en')).click(); // click on good option first
|
180 | 184 | element(by.cssContainingText('option', '...')).click(); // then click on option[0], the one containing '...'
|
| 185 | + element(by.css('body')).click(); |
181 | 186 | elmInput.sendKeys(protractor.Key.TAB);
|
182 | 187 |
|
183 | 188 | var elmError = $('.validation-select1');
|
|
191 | 196 | });
|
192 | 197 |
|
193 | 198 | it('Should enter valid text and make error go away', function () {
|
| 199 | + browser.sleep(2000); |
194 | 200 | for (var i = 0, ln = formElementNames.length; i < ln; i++) {
|
195 | 201 | // some fields are not required or disabled so no error will show up, continue to next ones
|
196 | 202 | if (formElementNames[i] === 'input12' || formElementNames[i] === 'input14') {
|
|
200 | 206 | elmInput.click();
|
201 | 207 | elmInput.sendKeys(validInputTexts[i]);
|
202 | 208 | elmInput.sendKeys(protractor.Key.TAB);
|
| 209 | + element(by.css('body')).click(); |
203 | 210 | //$('[for=' + formElementNames[i] + ']').click(); // click on label to blur away
|
204 | 211 |
|
205 | 212 | if (formElementNames[i] === 'select1') {
|
206 | 213 | element(by.cssContainingText('option', validInputTexts[i])).click(); // click on good option
|
207 | 214 | elmInput.sendKeys(protractor.Key.TAB);
|
| 215 | + element(by.css('body')).click(); |
208 | 216 | }
|
209 | 217 |
|
210 | 218 | var elmError = $('.validation-' + formElementNames[i]);
|
|
223 | 231 | // make input3 invalid, remove text
|
224 | 232 | var elmInput3 = $('[name=input3]');
|
225 | 233 | clearInput(elmInput3);
|
| 234 | + element(by.css('body')).click(); |
226 | 235 | elmInput3.sendKeys(protractor.Key.TAB);
|
227 | 236 | //$('[for=input3]').click(); // click on label to blur away
|
228 | 237 |
|
|
306 | 315 | it('Should focus and blur out of input22 & error should appear', function() {
|
307 | 316 | var elmInput = $('[name=input22]');
|
308 | 317 | elmInput.click();
|
| 318 | + element(by.css('body')).click(); |
309 | 319 | elmInput.sendKeys(protractor.Key.TAB);
|
310 | 320 | //$('[for=input22]').click(); // click on label to blur away
|
311 | 321 |
|
|
393 | 403 | var elmInput = $('[name=' + formElementNames[i] + ']');
|
394 | 404 | elmInput.click();
|
395 | 405 | elmInput.sendKeys(validInputTexts[i]);
|
| 406 | + element(by.css('body')).click(); |
396 | 407 | elmInput.sendKeys(protractor.Key.TAB);
|
397 | 408 |
|
398 | 409 | if (formElementNames[i] === 'select1') {
|
399 | 410 | element(by.cssContainingText('option', validInputTexts[i])).click(); // click on good option
|
| 411 | + element(by.css('body')).click(); |
400 | 412 | elmInput.sendKeys(protractor.Key.TAB);
|
401 | 413 | }
|
402 | 414 |
|
|
506 | 518 |
|
507 | 519 | if (formElement2FormsNames[i] === 'select1') {
|
508 | 520 | element(by.cssContainingText('option', validInput2FormsTexts[i])).click(); // click on good option
|
| 521 | + element(by.css('body')).click(); |
509 | 522 | elmInput.sendKeys(protractor.Key.TAB);
|
510 | 523 | }
|
511 | 524 |
|
|
587 | 600 | var elmInput = $('[name=' + formElement2FormsNames[i] + ']');
|
588 | 601 | elmInput.click();
|
589 | 602 | elmInput.sendKeys("a");
|
| 603 | + element(by.css('body')).click(); |
590 | 604 | elmInput.sendKeys(protractor.Key.TAB);
|
591 | 605 |
|
592 | 606 | // both inputs should have the same error message
|
|
0 commit comments