django-casper
django-casper copied to clipboard
submit form
Hi there, great work first of all; I had been looking for an integration with phantom for some time. Well done.
I've been using this app for some time; but have run into a strange situation where I am unable to submit a form and test the response and redirect.
Have you had this issue before?
I notice your tests have no test of a form submission? is this by design?
Thanks in advance Ross
Hey @rosscdh,
The form submissions tests worked for us. You can see one such test here: https://github.com/dobarkod/django-casper#passing-extra-arguments (the second one, form fill and submit). In the test after that we usually check the url of the page we arrived on to see whether the redirection was correct.
The issue may be in how you're waiting for the test. Recently we come to think that the scenario
helper might not be the best way to use Casper (as in some cases you want something else instead of then
). If you're using scenario
in the case where you have this problem, I'd suggest using the Casper API directly instead and seeing if it solves your problem
If you can consistently reproduce this, it would be great if you could give an example of a minimal case where it fails for you and I'll look into it in more detail.
Best, Senko
Thanks for the tip! ill investigate further.
I believe you are right regarding the "scenario" concept it adds a level of confusion especially for those witha bit of casperJS experience!
Thanks again and great work!
@senko Just a note the example above does not test for the form submit and the processes response.. ie when i submit this form i should be able to test what happens next.