Last active
August 29, 2016 20:38
-
-
Save dreamerkumar/1c0c41b3644ab822461f36ca68a76193 to your computer and use it in GitHub Desktop.
Protractor test to wait for a given number of milliseconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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