yii composer install
This commit is contained in:
28
tests/codeception/functional/LoginCept.php
Normal file
28
tests/codeception/functional/LoginCept.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use tests\codeception\_pages\LoginPage;
|
||||
|
||||
/* @var $scenario Codeception\Scenario */
|
||||
|
||||
$I = new FunctionalTester($scenario);
|
||||
$I->wantTo('ensure that login works');
|
||||
|
||||
$loginPage = LoginPage::openBy($I);
|
||||
|
||||
$I->see('Login', 'h1');
|
||||
|
||||
$I->amGoingTo('try to login with empty credentials');
|
||||
$loginPage->login('', '');
|
||||
$I->expectTo('see validations errors');
|
||||
$I->see('Username cannot be blank.');
|
||||
$I->see('Password cannot be blank.');
|
||||
|
||||
$I->amGoingTo('try to login with wrong credentials');
|
||||
$loginPage->login('admin', 'wrong');
|
||||
$I->expectTo('see validations errors');
|
||||
$I->see('Incorrect username or password.');
|
||||
|
||||
$I->amGoingTo('try to login with correct credentials');
|
||||
$loginPage->login('admin', 'admin');
|
||||
$I->expectTo('see user info');
|
||||
$I->see('Logout (admin)');
|
||||
Reference in New Issue
Block a user