Blame view

tests/acceptance/LoginCest.php 565 Bytes
2049c43e   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  <?php
  
  use yii\helpers\Url;
  
  class LoginCest
  {
      public function ensureThatLoginWorks(AcceptanceTester $I)
      {
          $I->amOnPage(Url::toRoute('/site/login'));
          $I->see('Login', 'h1');
  
          $I->amGoingTo('try to login with correct credentials');
          $I->fillField('input[name="LoginForm[username]"]', 'admin');
          $I->fillField('input[name="LoginForm[password]"]', 'admin');
          $I->click('login-button');
          $I->wait(2); // wait for button to be clicked
  
          $I->expectTo('see user info');
          $I->see('Logout');
      }
  }