Наследование: extends yii\codeception\BasePage
Пример #1
0
 /**
  *
  * @param \tests\codeception\frontend\FunctionalTester $I
  * @param \Codeception\Scenario $scenario
  */
 public function testUserSignup($I, $scenario)
 {
     $I->wantTo('ensure that signup works');
     $signupPage = SignupPage::openBy($I);
     $I->see('Signup', 'h1');
     $I->see('Please fill out the following fields to signup:');
     $I->amGoingTo('submit signup form with no data');
     $signupPage->submit([]);
     $I->expectTo('see validation errors');
     $I->see('Username cannot be blank.', '.help-block');
     $I->see('Email cannot be blank.', '.help-block');
     $I->see('Password cannot be blank.', '.help-block');
     $I->amGoingTo('submit signup form with not correct email');
     $signupPage->submit(['username' => 'tester', 'email' => 'tester.email', 'password' => 'tester_password']);
     $I->expectTo('see that email address is wrong');
     $I->dontSee('Username cannot be blank.', '.help-block');
     $I->dontSee('Password cannot be blank.', '.help-block');
     $I->see('Email is not a valid email address.', '.help-block');
     $I->amGoingTo('submit signup form with correct email');
     $signupPage->submit(['username' => 'tester', 'email' => '*****@*****.**', 'password' => 'tester_password']);
     $I->expectTo('see that user is created');
     $I->seeRecord('common\\models\\User', ['username' => 'tester', 'email' => '*****@*****.**']);
     $I->expectTo('see that user logged in');
     $I->seeLink('Logout (tester)');
 }
Пример #2
0
 /**
  * @param \tests\codeception\frontend\AcceptanceTester $I
  * @param \Codeception\Scenario $scenario
  */
 public function testUserSignup($I, $scenario)
 {
     $I->wantTo('ensure that signup works');
     $signupPage = SignupPage::openBy($I);
     $I->see('Signup', 'h1');
     $I->amGoingTo('submit signup form with no data');
     $signupPage->submit([]);
     $I->expectTo('see validation errors');
     $I->see('Username cannot be blank.', '.help-block');
     $I->see('E-mail cannot be blank.', '.help-block');
     $I->see('Password cannot be blank.', '.help-block');
     $I->amGoingTo('submit signup form with not correct email');
     $signupPage->submit(['username' => 'tester', 'email' => 'tester.email', 'password' => 'tester_password']);
     $I->expectTo('see that email address is wrong');
     $I->dontSee('Username cannot be blank.', '.help-block');
     $I->dontSee('Password cannot be blank.', '.help-block');
     $I->see('E-mail is not a valid email address.', '.help-block');
     $I->amGoingTo('submit signup form with correct email');
     $signupPage->submit(['username' => 'tester', 'email' => '*****@*****.**', 'password' => 'tester_password']);
     if (method_exists($I, 'wait')) {
         $I->wait(3);
         // only for selenium
     }
     $I->expectTo('see that user logged in');
     $I->click("tester", "a");
     $I->see("Logout", "a");
 }
Пример #3
0
 /**
  *
  * @param \codeception_frontend\FunctionalTester $I
  * @param \Codeception\Scenario $scenario
  */
 public function testUserSignup($I, $scenario)
 {
     $I->wantTo('ensure that signup works');
     $signupPage = SignupPage::openBy($I);
     $I->see('Регистрация', 'h1');
     $I->see('Пожалуйста заполните все поля формы:');
     $I->amGoingTo('submit signup form with no data');
     $signupPage->submit([]);
     $I->expectTo('see validation errors');
     $I->see('Необходимо заполнить «Логин».', '.help-block');
     $I->see('Необходимо заполнить «Email».', '.help-block');
     $I->see('Необходимо заполнить «Пароль».', '.help-block');
     $I->amGoingTo('submit signup form with not correct email');
     $signupPage->submit(['username' => 'tester', 'email' => 'tester.email', 'password' => 'tester_password']);
     $I->expectTo('see that email address is wrong');
     $I->dontSee('Необходимо заполнить «Логин».', '.help-block');
     $I->dontSee('Необходимо заполнить «Пароль».', '.help-block');
     $I->see('Значение «Email» не является правильным email адресом.', '.help-block');
     $I->amGoingTo('submit signup form with correct email');
     /*$signupPage->submit([
           'username' => 'tester',
           'email' => '*****@*****.**',
           'password' => 'tester_password',
           'passwordRepeat' => 'tester_password',
           'captcha' => 'testme',
       ]);
       $I->dontSee('The verification code is incorrect.', '.help-block');*/
     $I->expectTo('see that user is created');
     $I->seeRecord('common\\models\\ar\\User', ['username' => 'tester', 'email' => '*****@*****.**']);
     $I->expectTo('see that user logged in');
     $I->seeLink('Выход (tester)');
 }
Пример #4
0
 /**
  * Tests user signup with activation process.
  *
  * @param $I
  */
 private function testSignupWithActivation($I)
 {
     $I->wantTo('ensure that signup with activation works');
     $signupPage = SignupPage::openBy($I);
     $I->see('Signup', 'h1');
     $I->see('Please fill out the following fields to signup:');
     //-- submit signup form with correct data --//
     $I->amGoingTo('submit signup form with correct data');
     $signupPage->submit(['username' => 'demo', 'email' => '*****@*****.**', 'password' => 'asDF@#12asdf']);
     $I->expectTo('see that user is not logged in');
     $I->seeInCurrentUrl('signup');
     $I->see('Hello demo.', '.alert-success');
     $I->dontSeeLink('Logout (demo)');
 }
Пример #5
0
 /**
  *
  * @param \codeception_frontend\FunctionalTester $I
  * @param FunctionalTester $I
  * @param \Codeception\Scenario $scenario
  */
 public function testUserSignup($I, $scenario)
 {
     $I->wantTo('ensure that signup works');
     $signupPage = SignupPage::openBy($I);
     $I->see('Signup', 'h1');
     $I->see('Please fill out the following fields to signup:');
     $I->amGoingTo('submit signup form with no data');
     //$I->see('Signup', 'h1');
     //$I->see('Please fill out the following fields to signup:');
     $I->amGoingTo('submit signup form with no configs');
     $signupPage->submit([]);
     $I->expectTo('see validation errors');
     $I->see('Username cannot be blank.', '.help-block');
     $I->see('Email cannot be blank.', '.help-block');
     $I->see('Password cannot be blank.', '.help-block');
     $I->see('Необходимо заполнить «Имя пользователя (логин)».', '.help-block');
     $I->see('Необходимо заполнить «Email».', '.help-block');
     $I->see('Необходимо заполнить «Пароль».', '.help-block');
     $I->see('Необходимо заполнить «Повторно пароль».', '.help-block');
     $I->see('Необходимо заполнить «Фамилия».', '.help-block');
     $I->see('Необходимо заполнить «Подразделение».', '.help-block');
     $I->see('Необходимо заполнить «Должность».', '.help-block');
     $I->see('Необходимо заполнить «Внутренний телефон».', '.help-block');
     $I->amGoingTo('submit signup form with not correct email');
     $signupPage->submit(['username' => 'tester', 'email' => 'tester.email', 'password' => 'tester_password']);
     $I->expectTo('see that email address is wrong');
     $I->dontSee('Username cannot be blank.', '.help-block');
     $I->dontSee('Password cannot be blank.', '.help-block');
     $I->see('Email is not a valid email address.', '.help-block');
     $I->amGoingTo('submit signup form with correct email');
     $I->dontSee('Необходимо заполнить «Имя пользователя (логин)».', '.help-block');
     $I->dontSee('Необходимо заполнить «Пароль».', '.help-block');
     $I->see('Значение «Email» не является правильным email адресом.', '.help-block');
     $I->amGoingTo('submit signup form with not correct password_repeat');
     $signupPage->submit(['username' => 'tester', 'email' => '*****@*****.**', 'password' => 'tester_password', 'password_repeat' => 'password_tester']);
     $I->expectTo('see that password_repeat is wrong');
     $I->see('Значение «Пароль» должно быть повторено в точности.', '.help-block');
     $I->amGoingTo('submit signup form with correct data');
     $signupPage->submit(['username' => 'tester', 'email' => '*****@*****.**', 'password' => 'tester_password', 'password_repeat' => 'tester_password', 'lastName' => 'LastName', 'firstName' => 'FirstName', 'middleName' => 'MiddleName', 'division' => 'Division', 'post' => 'Post', 'phone' => '12-34', 'mobile' => '(910) 123-45-67']);
     $I->expectTo('see that user is created');
     $I->seeRecord('common\\models\\User', ['username' => 'tester', 'email' => '*****@*****.**']);
     $I->seeRecord('common\\models\\UserProfile', ['lastName' => 'LastName', 'firstName' => 'FirstName', 'middleName' => 'MiddleName', 'division' => 'Division', 'post' => 'Post', 'phone' => '12-34', 'mobile' => '(910) 123-45-67']);
     $I->expectTo('see that user logged in');
     $I->seeLink('Logout (tester)');
 }
Пример #6
0
 /**
  * @param \tests\codeception\frontend\AcceptanceTester $I
  * @param \Codeception\Scenario $scenario
  */
 public function testUserSignup($I, $scenario)
 {
     $I->wantTo('ensure that signup works');
     $signupPage = SignupPage::openBy($I);
     $I->see('Signup', 'h1');
     $I->see('Please fill out the following fields to signup:');
     $I->amGoingTo('submit signup form with no data');
     $signupPage->submit([]);
     $I->expectTo('see validation errors');
     $I->see('Email cannot be blank.', '.help-block');
     $I->see('Password cannot be blank.', '.help-block');
     $I->see('The verification code is incorrect', '.help-block');
     $I->amGoingTo('submit signup form with not correct email');
     $signupPage->submit(['email' => 'tester.email', 'password' => 'tester_password']);
     $I->expectTo('see that email address is wrong');
     $I->dontSee('Password cannot be blank.', '.help-block');
     $I->see('Email is not a valid email address.', '.help-block');
     $I->amGoingTo('submit signup form with correct email');
     $signupPage->submit(['email' => '*****@*****.**', 'password' => 'TesterPassword1', 'verifyCode' => 'testme']);
     $I->expectTo('see that user logged in');
     $I->see('Logout (tester.email@example.com)', 'form button[type=submit]');
 }
Пример #7
0
 /**
  * @param \codeception_frontend\AcceptanceTester $I
  * @param \Codeception\Scenario $scenario
  */
 public function testUserSignup($I, $scenario)
 {
     $I->wantTo('ensure that signup works');
     $signupPage = SignupPage::openBy($I);
     $I->see('注册', 'h1');
     //        $I->see('Please fill out the following fields to signup:');
     $I->amGoingTo('submit signup form with no data');
     $signupPage->submit([]);
     $I->expectTo('see validation errors');
     $I->see('用户名不能为空。', '.help-block');
     $I->see('邮箱不能为空。', '.help-block');
     $I->see('密码不能为空。', '.help-block');
     $I->amGoingTo('submit signup form with not correct email');
     $signupPage->submit(['username' => 'tester', 'email' => 'tester.email', 'password' => 'tester_password']);
     $I->expectTo('see that email address is wrong');
     $I->dontSee('Username cannot be blank.', '.help-block');
     $I->dontSee('Password cannot be blank.', '.help-block');
     $I->see('邮箱不是有效的邮箱地址。', '.help-block');
     $I->amGoingTo('submit signup form with correct email');
     $signupPage->submit(['username' => 'tester', 'email' => '*****@*****.**', 'password' => 'tester_password']);
     $I->expectTo('see that user logged in');
     $I->seeLink('退出 (tester)');
 }