Hi everyone…
I’m trying to run $I->seeRecord() in Functional Testes but I can’t do it, because of google reCaptcha in my SignupForm. Im the SignupForm the reCaptcha is required.
Ho to simulate a “click” in these captcha. I Alredy try to use $I->executeJS() but I receive an error
This is my test
public function signupSuccessfully(FunctionalTester $I)
{
$I->submitForm($this->formId, [
'SignupForm[username]' => '46188648009',
'SignupForm[email]' => 'tester.email@example.com',
'SignupForm[password]' => 'tester_password1',
'SignupForm[telefone]' => '000',
'SignupForm[nome]' => 'teste teste',
'SignupForm[endereco]' => 'teste',
'SignupForm[bairro]' => 'teste',
'SignupForm[cidade]' => 'teste',
'SignupForm[uf]' => 'SP',
'SignupForm[cep]' => '12345678',
'SignupForm[numero]' => '666',
'SignupForm[segundoaceitoreg]' => '1',
'SignupForm[aceitoregulamento]' => '1',
'SignupForm[password_repeat]' => 'tester_password1',
'SignupForm[email_repeat]' => 'tester.email@example.com',
//'SignupForm[reCaptcha]' => $reCaptcha,
]);
$I->seeRecord('common\models\User', [
'username' => '46188648009',
'email' => 'tester.email@example.com',
'status' => \common\models\User::STATUS_ACTIVE,
]);
}
The error:
vendor/bin/codecept run -- -c frontend functional SignupCest:signupSuccessfully
1) SignupCest: Signup successfully
Test tests/functional/SignupCest.php:signupSuccessfully
Step See record "common\models\User",{"username":"46188648009","email":"tester.email@example.com","status":10}
Fail Couldn't find common\models\User with {"username":"46188648009","email":"tester.email@example.com","status":10}
Scenario Steps:
3. $I->seeRecord("common\models\User",{"username":"46188648009","email":"tester.email@example.com","status":10}) at tests/functional/SignupCest.php:91
2. $I->submitForm("#form-signup",{"SignupForm[username]":"46188648009","SignupForm[email]":"tester.email@example.com","SignupForm[password]":"tester_password1","SignupForm[telefone]":"000","SignupForm[nome...}) at tests/functional/SignupCest.php:70
1. $I->amOnRoute("site/signup") at tests/functional/SignupCest.php:14
Could someone help me?
Thanks in advance.