public function testEditUserProfile(WebGuy $I, $scenario) { $I->dontSeeLink(\EditProfilePage::URL); $I->amOnPage(\EditProfilePage::URL); $I->seeInCurrentUrl('login'); $I->wantTo('Test user profile form...'); $I = new WebGuy\UserSteps($scenario); $I->login(\LoginPage::$userEmail, \LoginPage::$userPassword); $I->amOnPage(\EditProfilePage::URL); $I->see('E-Mail проверен', '.text-success'); $I->seeInTitle('Профиль пользователя'); $I->seeInField(\EditProfilePage::$emailField, \LoginPage::$userEmail); $I->see('Сохранить профиль', \CommonPage::BTN_PRIMARY_CSS_CLASS); $I->wantTo('Test change user email...'); $I = new WebGuy\UserSteps($scenario); $I->logout(); $I->changeEmail('*****@*****.**'); }
<?php use WebGuy\UserSteps; $I = new UserSteps($scenario); $I->wantTo('Log in and log out.'); // Wait one second before logging in so that our password expires. sleep(1); // todo: add test for account lockout, below code is not passing the tests // $I->login('*****@*****.**', 'demo34'); // $I->login('*****@*****.**', 'demo34'); // $I->see('Your account has been temporarily locked due to too many failed login attempts.'); // Wait one second before logging in again so that the lockout expires. // sleep(1); $I->login('*****@*****.**', 'demo12'); $I->see('Your password has expired.'); $I->fillField(\ChangePasswordPage::$fieldPassword, 'demo1234'); $I->fillField(\ChangePasswordPage::$fieldVerifyPassword, 'demo1234'); $I->click('#changePasswordForm button[type=submit]'); $I->logout();
<?php use WebGuy\UserSteps; $I = new UserSteps($scenario); $I->wantTo('Reset my password and log in.'); $I->amOnPage(\ForgotPasswordPage::$URL); $I->fillField(\ForgotPasswordPage::$fieldEmail, '*****@*****.**'); $I->click('#forgotPasswordForm button[type=submit]'); $I->see('Reset password'); $I->click('a'); $I->seeElement('#changePasswordForm'); $I->fillField(\ResetPasswordPage::$fieldPassword, 'demo1234'); $I->fillField(\ResetPasswordPage::$fieldVerifyPassword, 'demo1234'); $I->click('#changePasswordForm button[type=submit]'); $I->see('You have already used this password.'); $I->fillField(\ResetPasswordPage::$fieldPassword, 'demo4321'); $I->fillField(\ResetPasswordPage::$fieldVerifyPassword, 'demo4321'); $I->click('#changePasswordForm button[type=submit]'); $I->login('*****@*****.**', 'demo4321');
<?php use WebGuy\UserSteps; $I = new UserSteps($scenario); $I->wantTo('Sign up and activate my account.'); $I->signup('*****@*****.**', 'demo', 'demo12', 'demo12'); $I->see('Thank you for signing up'); $I->click('a'); $I->seeElement('#loginForm');