node-horseman
node-horseman copied to clipboard
Compact selector exists/visible conditionals
Wouldn't it be nice if instead of 4 lines to test for and act upon element existence/visibility:
.visible '#foo'
.then (a) ->
if a
# do something
...one would only need 2:
.if_visible '#foo', () ->
# do something
Or, same in javascript:
.visible('#foo')
.then(function(a) {
if (a) {
...
vs.
.if_visible('#foo', function() {
...