nathanboktae / mocha-casperjs

Write CasperJS tests using Mocha
MIT License
120 stars 29 forks source link

fetchText is not recognized as function #71

Closed cyberspeeyush closed 8 years ago

cyberspeeyush commented 8 years ago

Getting the below error:

←[0m←[31m TypeError: '/\.[^.]+$/' is not a function (evaluating 'this.fetchT ext('h3')')←[0m←[90m

The code is as follows:

describe('user can create reports', function() { it('should be able to open reports page', function () { casper.start('http://www.google.ie', function(){ console.log('Open google'); console.log('Page Title: '+ this.getTitle()); console.log('this: ' + this); console.log('Text : '+ this.fetchText('h3')) }, function(){ throw new Error('Not able to open CASPER'); }); }); `});``

Any help will be much appreciated. It was working fine before. It suddenly stopped working...

nathanboktae commented 8 years ago

Let me guess, are you on Windows? 6ec8ab6a

cyberspeeyush commented 8 years ago

yes. Thanks :)

nathanboktae commented 8 years ago

See #40. The hack got extended in #72.

It was working fine before. It suddenly stopped working...

It may be aggrevated by a specific PhantomJS or casperjs version. I'd try changing them.

It is the bizarrest bug I've ever seen, and different versions of windows affected it. So you'll have to dig in yourself you are still seeing it. I don't use Windows anymore.

cyberspeeyush commented 8 years ago

I reinstalled everything.. seems to be working fine now.

Thanks for looking into it.