yii2-netdisk/tests/functional/LoginCept.php

24 lines
585 B
PHP
Raw Normal View History

<?php
$I = new TestGuy($scenario);
$I->wantTo('ensure that login works');
$I->amOnPage('?r=site/login');
$I->see('Login', 'h1');
2013-10-18 20:03:36 +08:00
$I->submitForm('#login-form', []);
$I->dontSee('Logout (admin)');
$I->see('Username cannot be blank');
$I->see('Password cannot be blank');
2013-10-18 20:03:36 +08:00
$I->submitForm('#login-form', [
'LoginForm[username]' => 'admin',
'LoginForm[password]' => 'wrong',
2013-10-18 20:03:36 +08:00
]);
$I->dontSee('Logout (admin)');
$I->see('Incorrect username or password');
2013-10-18 20:03:36 +08:00
$I->submitForm('#login-form', [
'LoginForm[username]' => 'admin',
'LoginForm[password]' => 'admin',
2013-10-18 20:03:36 +08:00
]);
$I->see('Logout (admin)');