Created
March 16, 2015 20:30
-
-
Save grawk/65d26b5665ff9f1ecb10 to your computer and use it in GitHub Desktop.
illustrate waitForElementVisible test
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
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