On Wed, Jan 12, 2011 at 11:31 AM, djgoku <[email protected]> wrote:
> When you used Selenium did you do form testing? I am not sure what all
> needs to be tested.
>
> I currently have this(Test::WWW::Mechanize):
> $mech->get_ok('http://localhost:3000/form');
> $mech->title_is('AppName', 'Make sure were on the AppName page');
> $mech->submit_form_ok({form_number => 1, fields => { name => 'test'
> }}, 'adding a name worked');
>
> But if I change submit_form_ok to (the test still passes even though I
> didn't pass in the name field):
> $mech->submit_form_ok({form_number => 1}, 'adding a name shouldn''t work');

It looks to me like that probably should pass. It's checking that you
were able to successfully submit the form. Now, you may want to check
that the page that you received is the form again (and not the
"success" page) and has some kind of error message on it, like "You
forgot to fill out the name field" or some such.

Does that make sense?

-Andy
_______________________________________________
kc mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/kc

Reply via email to