Open divix1988 opened 6 months ago
What method do you use to display captcha in the template? by the way can you reproduce it with a sample repo?
@thinhbuzz I use a simple usage of: {!! app('captcha')->display() !!}
to display captcha.
Dusk is an automative test so it can be repped with any code, it's not related to environment.
I found this "partial" solution:
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
if (isset($_SERVER['DB_HOST_DUSK']) && $_SERVER['DB_HOST_DUSK'] === 'localhost') {
$this->app['validator']->extend('captcha', function() {
_log("Bypassing captcha validation for Dusk automation tests!");
return true;
});
}
}
The above works but it required injecting test specific code into app codebase, which I am not a big fan.
It would be great if plugin would detect some kind of ENV flag, which Dusk has and can define inside: .env.dusk
to bypass captcha checking. That's what I've done above.
Sorry for the late reply. Can you create a sample repository of the problem
I am running Dusk automation tests and none of this seem to work:
The error message is![image](https://github.com/thinhbuzz/laravel-google-captcha/assets/6444400/0a7bc864-50bf-403d-b5b3-7665bd6baccb)
Failed to validate the captcha
. How to sort it?