Skip to content

Commit

Permalink
Add successWithEmail method to LoginCest.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Dec 8, 2023
1 parent ab364a1 commit ef1fdf2
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion tests/Acceptance/LoginCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,30 @@ public function linkResendConfirmationMessage(AcceptanceTester $I): void
$I->accountConfirmation(false);
}

public function success(AcceptanceTester $I): void
public function successWithEmail(AcceptanceTester $I): void
{
$I->wantTo('security login username submit form success data.');
$I->haveFixtures([Account::class => AccountFixture::class]);
$account = $I->grabFixture(Account::class, 'confirmed');

$I->amGoingTo('navigate to the login page.');
$I->amOnRoute('login/index');

$I->wantTo('ensure that login page works.');
$I->expectTo('see page index.');
$I->see(Yii::t('yii.user', 'Sign in'), 'h1');
$I->see(Yii::t('yii.user', 'Please fill out the following fields to Sign in.'));

$I->expectTo('fill in the form.');
$I->fillField('#loginform-login', $account->email);
$I->fillField('#loginform-password', '123456');
$I->click(Yii::t('yii.user', 'Sign in'));

$I->expectTo('see that the user is logged in.');
$I->seeLink(Yii::t('yii.user', 'Logout'));
}

public function successWithUsername(AcceptanceTester $I): void
{
$I->wantTo('security login username submit form success data.');
$I->haveFixtures([Account::class => AccountFixture::class]);
Expand Down

0 comments on commit ef1fdf2

Please sign in to comment.