Skip to content

Instantly share code, notes, and snippets.

@grawk
Created March 16, 2015 20:30
Show Gist options
  • Save grawk/65d26b5665ff9f1ecb10 to your computer and use it in GitHub Desktop.
Save grawk/65d26b5665ff9f1ecb10 to your computer and use it in GitHub Desktop.
illustrate waitForElementVisible test
describe("@waitForElementVisible@ method", function() {
it("should be visible", function () {
assert.ok(nemo.drivex.waitForElementVisible);
});
it("should return true when an element is visible", function(done) {
nemo.driver.get(nemo.props.targetBaseUrl + '/waits');
nemo.drivex.waitForElementVisible({'locator': 'body', 'type': 'tagName'}, 5000, "couldn't find body tag").then(function(found) {
assert.equal(found, true);
done();
});
});
it("should reject promise when element is not visible", function(done) {
nemo.driver.get(nemo.props.targetBaseUrl + '/waits');
nemo.drivex.waitForElementVisible({'locator': 'bordy', 'type': 'tagName'}, 1000, "couldn't find bordy tag").then(function(elt) {
done(new Error('shouldnt have got here'));
}, function (err) {
done();
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment