Blame view

tests/codeception/frontend/functional/LoginCept.php 1012 Bytes
d8c1a2e0   Yarik   Big commit artbox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  <?php
  
  namespace tests\codeception\frontend\functional;
  
  use tests\codeception\frontend\FunctionalTester;
  use tests\codeception\common\_pages\LoginPage;
  
  /* @var $scenario \Codeception\Scenario */
  
  $I = new FunctionalTester($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');
  $I->see('Username cannot be blank.', '.help-block');
  $I->see('Password cannot be blank.', '.help-block');
  
  $I->amGoingTo('try to login with wrong credentials');
  $I->expectTo('see validations errors');
  $loginPage->login('admin', 'wrong');
  $I->expectTo('see validations errors');
  $I->see('Incorrect username or password.', '.help-block');
  
  $I->amGoingTo('try to login with correct credentials');
  $loginPage->login('erau', 'password_0');
  $I->expectTo('see that user is logged');
  $I->see('Logout (erau)', 'form button[type=submit]');
  $I->dontSeeLink('Login');
  $I->dontSeeLink('Signup');