Skip to content

Commit

Permalink
test(expression): add sleep(100) to protractor spec that uses alert
Browse files Browse the repository at this point in the history
In Chrome, if two alert boxes pop up, without enough time between them,
Protractor (or possibly ChromeDriver) sometimes fails to recognize the
second alert.
  • Loading branch information
petebacondarwin committed Jul 27, 2015
1 parent 861636c commit f91eb0e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/content/guide/expression.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ provide mockable access to globals.
}
element(by.css('[ng-click="greet()"]')).click();

// We need to give the browser time to display the alert
browser.sleep(100);

var alertDialog = browser.switchTo().alert();

expect(alertDialog.getText()).toEqual('Hello World');
Expand Down

0 comments on commit f91eb0e

Please sign in to comment.