fixing some tests

This commit is contained in:
Antonio Ramirez
2016-12-11 04:17:55 +01:00
parent d8e517a9d1
commit 0834ad6ca0
40 changed files with 1153 additions and 23 deletions

View File

@ -0,0 +1,41 @@
<?php
/**
* @var Codeception\Scenario $scenario
*/
use tests\_fixtures\UserFixture;
use tests\_pages\LoginPage;
$I = new FunctionalTester($scenario);
$I->wantTo('ensure that login works');
$I->haveFixtures(['user' => UserFixture::className()]);
$page = LoginPage::openBy($I);
$I->amGoingTo('try to login with empty credentials');
$page->login('', '');
$I->expectTo('see validations errors');
$I->see('Login cannot be blank.');
$I->see('Password cannot be blank.');
$I->amGoingTo('try to login with unconfirmed account');
$user = $I->grabFixture('user', 'unconfirmed');
$page->login($user->email, 'qwerty');
$I->see('You need to confirm your email address');
$I->amGoingTo('try to login with blocked account');
$user = $I->grabFixture('user', 'blocked');
$page->login($user->email, 'qwerty');
$I->see('Your account has been blocked');
$I->amGoingTo('try to login with wrong credentials');
$user = $I->grabFixture('user', 'user');
$page->login($user->email, 'wrong');
$I->expectTo('see validations errors');
$I->see('Invalid login or password');
$I->amGoingTo('try to login with correct credentials');
$page->login($user->email, 'qwerty');
$I->dontSee('Login');
$I->see('Logout');