You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
991 B
33 lines
991 B
11 years ago
|
<?php
|
||
10 years ago
|
use codeception_frontend\WebGuy;
|
||
|
use codeception\common\_pages\LoginPage;
|
||
11 years ago
|
|
||
|
$I = new WebGuy($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');
|
||
11 years ago
|
$I->see('Username cannot be blank.', '.help-block');
|
||
|
$I->see('Password cannot be blank.', '.help-block');
|
||
11 years ago
|
|
||
|
$I->amGoingTo('try to login with wrong credentials');
|
||
|
$I->expectTo('see validations errors');
|
||
|
$loginPage->login('admin', 'wrong');
|
||
|
$I->expectTo('see validations errors');
|
||
11 years ago
|
$I->see('Incorrect username or password.', '.help-block');
|
||
11 years ago
|
|
||
|
$I->amGoingTo('try to login with correct credentials');
|
||
|
$loginPage->login('erau', 'password_0');
|
||
|
$I->expectTo('see that user is logged');
|
||
11 years ago
|
$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');
|
||
|
*/
|