casper-chai
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -36,3 +36,3 @@ | ||
}); | ||
_chai.Assertion.addProperty('isVisible', function() { | ||
_chai.Assertion.addProperty('visible', function() { | ||
var selector; | ||
@@ -43,3 +43,3 @@ selector = this._obj; | ||
}); | ||
_chai.Assertion.addProperty('isLoaded', function() { | ||
_chai.Assertion.addProperty('loaded', function() { | ||
var resourceTest; | ||
@@ -46,0 +46,0 @@ resourceTest = this._obj; |
@@ -1,1 +0,1 @@ | ||
(function(){var t;t=function(t,e){var i;i=function(t,e){var i;console.log();if(typeof t==="string"){i=new RegExp("^"+t+"$")}else if(_.isRegExp(t)){i=t}else{throw new Error("Test received "+t+", but expected string",+" or regular expression.")}return i.test(e)};t.Assertion.addProperty("inDOM",function(){var t;t=this._obj;return this.assert(casper.exists(t),"expected selector #{this} to be in the DOM, but it was not","expected selector #{this} to not be in the DOM, but it was")});t.Assertion.addProperty("isVisible",function(){var t;t=this._obj;expect(t).to.be.inDOM;return this.assert(casper.visible(t),"expected selector #{this} to be visible, but it was not","expected selector #{this} to not be, but it was")});t.Assertion.addProperty("isLoaded",function(){var t;t=this._obj;return this.assert(casper.resourceExists(t),"expected resource #{this} to exist, but it does not","expected resource #{this} to not exist, but it does")});t.Assertion.addProperty("matchTitle",function(){var t,e;t=this._obj;e=casper.getTitle();return this.assert(i(t,e),"expected title #{this} to match #{exp}, but it did not","expected title #{this} to not match #{exp}, but it did")});t.Assertion.addProperty("matchCurrentUrl",function(){var t,e;e=this._obj;t=casper.getCurrentUrl();return this.assert(i(e,t),"expected url #{exp} to match #{this}, but it did not","expected url #{exp} to not match #{this}, but it did")});t.Assertion.addProperty("textInDOM",function(){var t,e;e=this._obj;t=casper.evaluate(function(){return document.body.textContent||document.body.innerText});return this.assert(t.indexOf(e)!==-1,"expected text #{this} to be in the document, but it was not","expected text #{this} to not be in the document, but it was found")});t.Assertion.addMethod("textMatch",function(t){var e,s;e=this._obj;s=casper.fetchText(e);return this.assert(i(t,s),"expected '"+e+"' to match "+t+", but it did not","expected '"+e+"' to not match "+t+", but it did")});return t.Assertion.addMethod("fieldValue",function(t){var e,i,s;s=this._obj;if(_.isString(s)){}else{expect(s).to.be.inDOM}e=function(t){return __utils__.getFieldValue(t)};i=casper.evaluate(e,{selector:s});return this.assert(i===t,"expected field(s) "+s+" to have value "+t+", "+("but it was "+i),"expected field(s) "+s+" to not have value "+t+", "+"but it was")})};if(typeof require==="function"&&typeof exports==="object"&&typeof module==="object"){module.exports=t}else if(typeof define==="function"&&define.amd){define(function(){return t})}else{chai.use(t)}}).call(this); | ||
(function(){var t;t=function(t,e){var i;i=function(t,e){var i;console.log();if(typeof t==="string"){i=new RegExp("^"+t+"$")}else if(_.isRegExp(t)){i=t}else{throw new Error("Test received "+t+", but expected string",+" or regular expression.")}return i.test(e)};t.Assertion.addProperty("inDOM",function(){var t;t=this._obj;return this.assert(casper.exists(t),"expected selector #{this} to be in the DOM, but it was not","expected selector #{this} to not be in the DOM, but it was")});t.Assertion.addProperty("visible",function(){var t;t=this._obj;expect(t).to.be.inDOM;return this.assert(casper.visible(t),"expected selector #{this} to be visible, but it was not","expected selector #{this} to not be, but it was")});t.Assertion.addProperty("loaded",function(){var t;t=this._obj;return this.assert(casper.resourceExists(t),"expected resource #{this} to exist, but it does not","expected resource #{this} to not exist, but it does")});t.Assertion.addProperty("matchTitle",function(){var t,e;t=this._obj;e=casper.getTitle();return this.assert(i(t,e),"expected title #{this} to match #{exp}, but it did not","expected title #{this} to not match #{exp}, but it did")});t.Assertion.addProperty("matchCurrentUrl",function(){var t,e;e=this._obj;t=casper.getCurrentUrl();return this.assert(i(e,t),"expected url #{exp} to match #{this}, but it did not","expected url #{exp} to not match #{this}, but it did")});t.Assertion.addProperty("textInDOM",function(){var t,e;e=this._obj;t=casper.evaluate(function(){return document.body.textContent||document.body.innerText});return this.assert(t.indexOf(e)!==-1,"expected text #{this} to be in the document, but it was not","expected text #{this} to not be in the document, but it was found")});t.Assertion.addMethod("textMatch",function(t){var e,s;e=this._obj;s=casper.fetchText(e);return this.assert(i(t,s),"expected '"+e+"' to match "+t+", but it did not","expected '"+e+"' to not match "+t+", but it did")});return t.Assertion.addMethod("fieldValue",function(t){var e,i,s;s=this._obj;if(_.isString(s)){}else{expect(s).to.be.inDOM}e=function(t){return __utils__.getFieldValue(t)};i=casper.evaluate(e,{selector:s});return this.assert(i===t,"expected field(s) "+s+" to have value "+t+", "+("but it was "+i),"expected field(s) "+s+" to not have value "+t+", "+"but it was")})};if(typeof require==="function"&&typeof exports==="object"&&typeof module==="object"){module.exports=t}else if(typeof define==="function"&&define.amd){define(function(){return t})}else{chai.use(t)}}).call(this); |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"author": "Brian M Hunt <brianmhunt@gmail.com>", | ||
@@ -13,0 +13,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
405596
10
1
118