Добавлена форма смены пароля и её тесты

This commit is contained in:
ErickSkrauch
2016-02-27 01:22:09 +03:00
parent 86c63f8724
commit 93a94c656b
7 changed files with 259 additions and 24 deletions

View File

@ -0,0 +1,44 @@
<?php
namespace tests\codeception\api\functional;
use Codeception\Scenario;
use Codeception\Specify;
use tests\codeception\api\_pages\AccountsRoute;
use tests\codeception\api\_pages\LoginRoute;
use tests\codeception\api\functional\_steps\AccountSteps;
use tests\codeception\api\FunctionalTester;
class AccountsCurrentCest {
/**
* @var AccountsRoute
*/
private $route;
public function _before(FunctionalTester $I) {
$this->route = new AccountsRoute($I);
}
public function testChangePassword(FunctionalTester $I, Scenario $scenario) {
$I->wantTo('change my password');
$I = new AccountSteps($scenario);
$I->loggedInAsActiveAccount();
$this->route->changePassword('password_0', 'new-password', 'new-password');
$I->canSeeResponseCodeIs(200);
$I->canSeeResponseIsJson();
$I->canSeeResponseContainsJson([
'success' => true,
]);
$I->notLoggedIn();
$loginRoute = new LoginRoute($I);
$loginRoute->login('Admin', 'new-password');
$I->canSeeResponseCodeIs(200);
$I->canSeeResponseContainsJson([
'success' => true,
]);
}
}