mirror of
https://github.com/elyby/accounts.git
synced 2024-11-10 23:42:09 +05:30
35 lines
1.0 KiB
PHP
35 lines
1.0 KiB
PHP
<?php
|
|
use tests\codeception\api\_pages\LoginRoute;
|
|
use tests\codeception\api\AcceptanceTester;
|
|
|
|
/* @var $scenario Codeception\Scenario */
|
|
|
|
$I = new AcceptanceTester($scenario);
|
|
$I->wantTo('ensure login page works');
|
|
|
|
$loginPage = LoginRoute::openBy($I);
|
|
|
|
$I->amGoingTo('submit login form with no data');
|
|
$loginPage->login('', '');
|
|
$I->expectTo('see validations errors');
|
|
$I->see('Username cannot be blank.', '.help-block');
|
|
$I->see('Password cannot be blank.', '.help-block');
|
|
|
|
$I->amGoingTo('try to login with wrong credentials');
|
|
$I->expectTo('see validations errors');
|
|
$loginPage->login('admin', 'wrong');
|
|
$I->expectTo('see validations errors');
|
|
$I->see('Incorrect username or password.', '.help-block');
|
|
|
|
$I->amGoingTo('try to login with correct credentials');
|
|
$loginPage->login('erau', 'password_0');
|
|
$I->expectTo('see that user is logged');
|
|
$I->seeLink('Logout (erau)');
|
|
$I->dontSeeLink('Login');
|
|
$I->dontSeeLink('Signup');
|
|
/** Uncomment if using WebDriver
|
|
* $I->click('Logout (erau)');
|
|
* $I->dontSeeLink('Logout (erau)');
|
|
* $I->seeLink('Login');
|
|
*/
|