nathanboktae / mocha-casperjs

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

casper.click on link with return false #29

Closed adampatarino closed 10 years ago

adampatarino commented 10 years ago

I've posted an issue to casperjs, but with the number of open issues, I'm worried it may get buried.

I was hoping you might be able to point me in the right direction? Basically I'm having trouble getting casper to click a button that adds a product to a cart via ajax. I do not have access to the websites I'm testing, so the source code is out of my control.

The casper.click method does not seem to fire the javascript tied to the link's onclick property. The link returns false and has an href of '#', which I suspect is the issue? Do you know of some way in casper to fire this event and trigger the ajax request?

Thanks for your time.

nathanboktae commented 10 years ago

Likely it's more of a PhantomJS issue. Remember you can debug the page under test, and you can also try the click in pure PhantomJS too (try your jQuery click via an evaluate there)

adampatarino commented 10 years ago

Ok thanks @nathanboktae

The more I mess with it, the more I think it has to do with the source. Appreciate the guidance.