2016-07-15 00:20:28 +08:00
|
|
|
<?php
|
2017-09-12 17:29:58 +08:00
|
|
|
|
|
|
|
use yii\helpers\Url;
|
2016-07-15 00:20:28 +08:00
|
|
|
|
|
|
|
class LoginCest
|
|
|
|
{
|
|
|
|
public function ensureThatLoginWorks(AcceptanceTester $I)
|
|
|
|
{
|
2016-07-16 09:13:51 +08:00
|
|
|
$I->amOnPage(Url::toRoute('/site/login'));
|
2016-07-15 00:20:28 +08:00
|
|
|
$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');
|
2016-07-16 09:13:51 +08:00
|
|
|
$I->wait(2); // wait for button to be clicked
|
2016-07-15 00:20:28 +08:00
|
|
|
|
|
|
|
$I->expectTo('see user info');
|
2016-07-16 09:13:51 +08:00
|
|
|
$I->see('Logout');
|
2016-07-15 00:20:28 +08:00
|
|
|
}
|
|
|
|
}
|