Last active
August 29, 2015 14:02
-
-
Save gregwym/a34479a4084be3ecc51c to your computer and use it in GitHub Desktop.
Add element.isShown method to admc/wd Node.js webdriver.
This file contains hidden or 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
wd.addElementAsyncMethod('isShown', function isShown () { | |
var cb = wd.findCallback(arguments); | |
var el = this; | |
return el.getComputedCss('display', function(err, display) { | |
if (err) cb(err); | |
return el.getComputedCss('visibility', function(err, visibility) { | |
if (err) cb(err); | |
cb(null, display !== 'none' && visibility !== 'hidden'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment