0
Я должен проверить свою регистрационную форму, но я не знаю, как проверить поле reCaptcha.laravel 5 unit testing captcha
я получаю ошибку:
HomeTest::testNewUserRegistration InvalidArgumentException: Nothing matched the filter [captcha] CSS query provided for [ http://localhost/auth/register] .
вот мой текущий тест:
public function testNewUserRegistration()
{
$faker = Faker\Factory::create();
$this->visit(route('auth.register'))
->type($faker->firstNameMale, 'firstname')
->type($faker->lastName, 'lastname')
->type($faker->userName, 'username')
->type($faker->email, 'email')
->attach($faker->imageUrl(), 'avatar')
->type($faker->password, 'password')
->type($faker->password, 'password_confirmation')
->check('terms')
->check('captcha')
->press('Envoyer')
->seePageIs('/');
}
в моей форме я заявляю о своем капчу как:
<div class="field {!! $errors->has('g-recaptcha-response') ? 'error' : '' !!}">
{!! app('captcha')->display() !!}
{!! $errors->first('g-recaptcha-response', '<span class="ui text" style="color: #bf4d4b">:message</span>') !!}
</div>