Doesn't work
Closed this issue · 2 comments
inadarei commented
Installation:
> npm install -g phantomjs
> npm install -g casperjs
> npm install -g mocha-casperjs
> npm install -g casper-chai
Run:
> mocha-casperjs tests/basic.js
gives following errors:
Google searching
1) should retrieve 10 or more results
0 passing (257ms)
1 failing
1) Google searching should retrieve 10 or more results:
TypeError: 'undefined' is not an object (evaluating ''Google'.should.matchTitle')
at /path/to/tests/basic.js:8
at runStep (/home/irakli/.nvm/v0.10.33/lib/node_modules/casperjs/modules/casper.js:1553)
at checkStep (/home/irakli/.nvm/v0.10.33/lib/node_modules/casperjs/modules/casper.js:399)
where tests/basic.js is exactly the example from your github page:
describe('Google searching', function() {
before(function() {
casper.start('http://www.google.fr/')
})
it('should retrieve 10 or more results', function() {
casper.then(function() {
'Google'.should.matchTitle
'form[action="/search"]'.should.be.inDOM.and.be.visible
this.fill('form[action="/search"]', {
q: 'casperjs'
}, true)
})
casper.waitForUrl(/q=casperjs/, function() {
(/casperjs/).should.matchTitle
})
})
})
inadarei commented
Nevermind, it required
npm install -g mocha
npm install -g chai
nathanboktae commented
mocha
and casperjs
are peer dependencies of mocha-casperjs
so you don't need to explicitly install them. chai
and casper-chai
are optional so they are called out as dependencies, but the example does use it.