You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
565 B

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