Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReCAPTCHA in CI Testing

Tags:

recaptcha

I am looking for a way to run tests on new user creation. The new user process has a ReCaptcha in it and (obviously) tests are bots so I have created a work around I don't like.

On the server I look for a new user with a specific name. When I see this user, I ignore the CAPTCHA and let it process normally. This is not good because I do not care for bypass logic being built into a server.

The E2E test even responds to the email that the server sends.

The question is: Is there a test reCaptcha that I can use when running tests whose query/response is not publically known but known only to me? e.g. Can I make this a repeatable test?

like image 786
Nathaniel Johnson Avatar asked Sep 21 '25 05:09

Nathaniel Johnson


1 Answers

Not sure if this was available back when the question was originally asked, but Google now includes specific test keys in their reCaptcha FAQs:

enter image description here https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha-v2-what-should-i-do

like image 193
DeveloperDemetri Avatar answered Sep 23 '25 12:09

DeveloperDemetri