mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Codeception test adjustments for basic and advanced applications
- Moved everything test-related into `tests` directory. Codeception tests are in `codeception`. - Removed database module since we're using fixtures and migrations. - Moved console entry points and bootstrap into `tests/codeception/bin`. - Adjusted travis build scripts. - Adjusted documentation to be consistent and reflect changes made.
This commit is contained in:
26
apps/basic/tests/codeception/functional/LoginCept.php
Normal file
26
apps/basic/tests/codeception/functional/LoginCept.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use codeception\_pages\LoginPage;
|
||||
|
||||
$I = new TestGuy($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