Skip to content

Instantly share code, notes, and snippets.

@dreamerkumar
Last active August 29, 2016 20:38
Show Gist options
  • Save dreamerkumar/1c0c41b3644ab822461f36ca68a76193 to your computer and use it in GitHub Desktop.
Save dreamerkumar/1c0c41b3644ab822461f36ca68a76193 to your computer and use it in GitHub Desktop.
Protractor test to wait for a given number of milliseconds
this.Then(/^Wait for (\d+) milliseconds$/, function (numberOfMilliseconds) {
var d = protractor.promise.defer();
console.log('WAITING 10 SECONDS');
setTimeout(function () {
console.log("fulfill");
d.fulfill('ok');
}, numberOfMilliseconds);
return d;
});
//It is called this way from Gherkin
//..
//..
// And Wait for 10000 milliseconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment