Skip to content

Commit e0e5c70

Browse files
test(expression): add sleep(100) to protractor spec that uses alert
In Chrome, if two alert boxes pop up, without enough time between them, Protractor (or possibly ChromeDriver) sometimes fails to recognize the second alert.
1 parent 33af1d7 commit e0e5c70

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/content/guide/expression.ngdoc

+3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ provide mockable access to globals.
141141
}
142142
element(by.css('[ng-click="greet()"]')).click();
143143

144+
// We need to give the browser time to display the alert
145+
browser.sleep(100);
146+
144147
var alertDialog = browser.switchTo().alert();
145148

146149
expect(alertDialog.getText()).toEqual('Hello World');

0 commit comments

Comments
 (0)