Skip to content

Instantly share code, notes, and snippets.

@thingsinjars
Created September 20, 2013 19:30
Show Gist options
  • Save thingsinjars/6642623 to your computer and use it in GitHub Desktop.
Save thingsinjars/6642623 to your computer and use it in GitHub Desktop.
/* "<Given> I wait for "N" seconds */
this.Given(/^I wait for "([^"]*)" seconds$/, function (seconds, callback) {
this.pause(seconds*1000, callback);
});
/* "<Given> I wait for "elementname" to be present" */
this.Given(/^I wait for "([^"]*)" to be present$/, function (selector, callback) {
selector = selectors(selector);
this.waitFor(selector, 1000, function (err, result) {
if(err) {
return callback.fail(JSON.stringify(err));
}
callback();
});
});
@thingsinjars
Copy link
Author

These would expose WebDriverJS's waitFor and Pause methods via Hardy's generic steps file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment