2013-12-02 19:25:21 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace tests\_pages;
|
|
|
|
|
2013-12-17 07:27:33 +08:00
|
|
|
use yii\codeception\BasePage;
|
2013-12-02 19:25:21 +08:00
|
|
|
|
2013-12-17 07:27:33 +08:00
|
|
|
class LoginPage extends BasePage
|
|
|
|
{
|
2013-12-18 12:43:43 +08:00
|
|
|
public $route = 'site/login';
|
2013-12-02 19:25:21 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $username
|
|
|
|
* @param string $password
|
|
|
|
*/
|
|
|
|
public function login($username, $password)
|
|
|
|
{
|
2014-02-14 08:37:49 +08:00
|
|
|
$this->guy->fillField('input[name="LoginForm[username]"]', $username);
|
|
|
|
$this->guy->fillField('input[name="LoginForm[password]"]', $password);
|
2014-02-14 10:18:43 +08:00
|
|
|
$this->guy->click('login-button');
|
2013-12-02 19:25:21 +08:00
|
|
|
}
|
|
|
|
}
|