nathanboktae / mocha-casperjs

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

Test No Longer Passes #92

Closed dschinkel closed 8 years ago

dschinkel commented 8 years ago

I spent 2 hours looking at this with no luck.

I've got a situation where now, the same test, same code will not pass. You run localhost:3000 and the text that fetchText was checking is there, but for some reason, it's failing, even though that text is there in the browser.

This is a test that was working fine, and the same text has been rendered to that page for a long time now. For some reason casper.fetchText('h3') is returning an empty string whereas yesterday it was working fine.

I've shared my code to you Nathan, so that you may clone and run it. Just type gulp at the command-line to run it and you will see what I'm referring to.

https://github.com/dschinkel/we-do-tdd

dschinkel commented 8 years ago

this is still a problem. Check out my latest code in that repo...pull it down. You'll notice that the bundle file gets created, the express server runs, then go to localhost:3000, see that it renders the text "No Companies Found" yet my test which had been passing a while back is no longer passing for that fetchText.

nathanboktae commented 8 years ago

Are you using windows?

dschinkel commented 8 years ago

no OS X

nathanboktae commented 8 years ago

For some reason casper.fetchText('h3') is returning an empty string whereas yesterday it was working fine.

Then it's a regression in casperjs or a legitimate test breakage.

dschinkel commented 8 years ago

well it was passing a while back so...doesn't make sense. I'll keep looking at it but nothing seems to stick out as to why now it's not passing when the text is on that page. I haven't updated casper so my middleware hasn't changed.

dschinkel commented 8 years ago

well or...

$ npm update
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "update"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.9
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: casperjs@'>=1.1.0 <2.0.0'
npm ERR! notarget Valid install targets:
npm ERR! notarget 1.1.0-beta2, 1.1.0-beta3, 1.1.0-beta4, 1.1.0-beta5
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dave/code/projects/we-do-tdd/npm-debug.log
 npm install
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.9

npm ERR! No compatible version found: casperjs@^1.1.0
npm ERR! Valid install targets:
npm ERR! 1.1.0-beta5, 1.1.0-beta4, 1.1.0-beta3, 1.1.0-beta2
npm ERR! 
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dave/code/projects/we-do-tdd/npm-debug.log
dschinkel commented 8 years ago

I don't know what's going on, so now I can't do an npm install because that fails above. I haven't changed a damn thing in my package.json for a long time in terms of casper stuff. Why would I be getting this error now?

So do I need to just install mocha-casperjs only? Do I need also npm install --save-dev casper and/or npm install --save-dev casperjs?

https://www.npmjs.com/package/casperjs https://www.npmjs.com/package/casper

dschinkel commented 8 years ago

well the npm install issue is fixed https://github.com/n1k0/casperjs/issues/1525

still working on figuring out why my tests isn't passing.

dschinkel commented 8 years ago

Christ, the problem is that since I'm rendering a react component, it's rendered to the DOM as <h3 data-reactid=".0.0"> which is why my test is failing. When I try hard coding it into my index.html as <h3>No Companies found</h3> it works again. Errr...

dschinkel commented 8 years ago

it may be a timing issue, I can't see how yet, looking into it...I'll report back later.

dschinkel commented 8 years ago

I appreciate your support Nathan, unlike what I got over at the Casper site.