[Catalyst] Automated testing of Captcha?

Jonathan Rockway jon at jrock.us
Mon Jan 21 21:24:31 GMT 2008


On Mon, 2008-01-21 at 14:19 -0700, Christopher Dorman wrote:
> I am using T::W::M::C to test a page that has a (required) Captcha 
> field.  In order for it to pass validation, the correct value needs to 
> be passed in.
> 
> Is it possible to grab the "correct" captcha value in the test script so 
> that validation can succeed, or do we need to set some environment 
> variable that we check in the validation to give the field a pass?  What 
> does everyone else do?

In your test file, you probably want to do something like:

  local *My::Captcha::Engine::_make_random_word = sub { "HELLO" }

Then your captcha will always be "HELLO".

Regards,
Jonathan Rockway

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080121/58fb3beb/attachment.pgp


More information about the Catalyst mailing list