Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Last active December 10, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfirebaugh/4365642 to your computer and use it in GitHub Desktop.
Save jfirebaugh/4365642 to your computer and use it in GitHub Desktop.
function CasperSelector(casper, selector) {
this.casper = casper;
this.selector = selector;
}
CasperSelector.prototype.visible = function() {
return this.casper.visible(this.selector);
};
Casper.prototype.find = function(selector) {
return new CasperSelector(this, selector);
};
chai.Assertion.addProperty('visible', function () {
this.assert(
flag(this, 'object').visible(),
, 'expected #{this} to be visible'
, 'expected #{this} not to be visible');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment