2013-12-02 19:25:21 +08:00
|
|
|
<?php
|
|
|
|
|
2014-08-24 18:14:35 +08:00
|
|
|
namespace tests\codeception\_pages;
|
2013-12-02 19:25:21 +08:00
|
|
|
|
2013-12-17 07:27:33 +08:00
|
|
|
use yii\codeception\BasePage;
|
2013-12-02 19:25:21 +08:00
|
|
|
|
2014-08-16 22:15:41 +08:00
|
|
|
/**
|
|
|
|
* Represents login page
|
|
|
|
* @property \AcceptanceTester|\FunctionalTester $actor
|
|
|
|
*/
|
2013-12-17 07:27:33 +08:00
|
|
|
class LoginPage extends BasePage
|
|
|
|
{
|
2014-03-16 12:46:16 +08:00
|
|
|
public $route = 'site/login';
|
2013-12-02 19:25:21 +08:00
|
|
|
|
2014-03-16 12:46:16 +08:00
|
|
|
/**
|
|
|
|
* @param string $username
|
|
|
|
* @param string $password
|
|
|
|
*/
|
|
|
|
public function login($username, $password)
|
|
|
|
{
|
2014-08-16 22:15:41 +08:00
|
|
|
$this->actor->fillField('input[name="LoginForm[username]"]', $username);
|
|
|
|
$this->actor->fillField('input[name="LoginForm[password]"]', $password);
|
|
|
|
$this->actor->click('login-button');
|
2014-03-16 12:46:16 +08:00
|
|
|
}
|
2013-12-02 19:25:21 +08:00
|
|
|
}
|