initial commit
This commit is contained in:
30
tests/codeception/backend/functional/LoginCept.php
Normal file
30
tests/codeception/backend/functional/LoginCept.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use tests\codeception\backend\FunctionalTester;
|
||||
use tests\codeception\common\_pages\LoginPage;
|
||||
|
||||
/* @var $scenario Codeception\Scenario */
|
||||
|
||||
$I = new FunctionalTester($scenario);
|
||||
$I->wantTo('ensure login page works');
|
||||
|
||||
$loginPage = LoginPage::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');
|
||||
2
tests/codeception/backend/functional/_bootstrap.php
Normal file
2
tests/codeception/backend/functional/_bootstrap.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
new yii\web\Application(require(dirname(dirname(__DIR__)) . '/config/backend/functional.php'));
|
||||
Reference in New Issue
Block a user