Skip to content

Instantly share code, notes, and snippets.

@yupe
Created February 4, 2014 19:52
Show Gist options
  • Save yupe/8811036 to your computer and use it in GitHub Desktop.
Save yupe/8811036 to your computer and use it in GitHub Desktop.
<?php
namespace tests\_pages\user;
use yii\codeception\BasePage;
class LoginPage extends BasePage
{
public $route = 'account/login';
public $loginField = 'LoginForm[username]';
/**
* @param string $username
* @param string $password
*/
public function login($username, $password)
{
$I = $this->guy;
$I->see('Login', 'h1');
$I->see('Login', '.btn-primary');
$I->amGoingTo('try to login with empty credentials');
$I->fillField('#loginform-username', 'xoma@xoma.ru');
$I->fillField('#loginform-password', 'testpassword');
$I->uncheckOption('#loginform-rememberme');
$I->click('#login-btn');
$I->wait(2);
$I->see('You have successfully created your Yii-powered application.');
$I->see('Logout (xoma)');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment