Refactored codeception/BasePage.

This commit is contained in:
Qiang Xue 2013-12-17 23:43:43 -05:00
parent 3c07648ba2
commit 0acc59170f
9 changed files with 14 additions and 14 deletions

View File

@ -6,5 +6,5 @@ use yii\codeception\BasePage;
class AboutPage extends BasePage
{
public static $URL = '?r=site/about';
public $route = 'site/about';
}

View File

@ -6,7 +6,7 @@ use yii\codeception\BasePage;
class ContactPage extends BasePage
{
public static $URL = '?r=site/contact';
public $route = 'site/contact';
/**
* contact form name text field locator

View File

@ -6,7 +6,7 @@ use yii\codeception\BasePage;
class LoginPage extends BasePage
{
public static $URL = '?r=site/login';
public $route = 'site/login';
/**
* login form username text field locator

View File

@ -4,5 +4,5 @@ use tests\_pages\AboutPage;
$I = new WebGuy($scenario);
$I->wantTo('ensure that about works');
$I->amOnPage(AboutPage::$URL);
AboutPage::openBy($I);
$I->see('About', 'h1');

View File

@ -4,9 +4,9 @@ use tests\_pages\ContactPage;
$I = new WebGuy($scenario);
$I->wantTo('ensure that contact works');
$contactPage = ContactPage::of($I);
$I->amOnPage(ContactPage::$URL);
$contactPage = ContactPage::openBy($I);
$I->see('Contact', 'h1');
$I->amGoingTo('submit contact form with no data');

View File

@ -4,9 +4,9 @@ use tests\_pages\LoginPage;
$I = new WebGuy($scenario);
$I->wantTo('ensure that login works');
$loginPage = LoginPage::of($I);
$I->amOnPage(LoginPage::$URL);
$loginPage = LoginPage::openBy($I);
$I->see('Login', 'h1');
$I->amGoingTo('try to login with empty credentials');

View File

@ -4,5 +4,5 @@ use tests\_pages\AboutPage;
$I = new TestGuy($scenario);
$I->wantTo('ensure that about works');
$I->amOnPage(AboutPage::$URL);
AboutPage::openBy($I);
$I->see('About', 'h1');

View File

@ -4,9 +4,9 @@ use tests\functional\_pages\ContactPage;
$I = new TestGuy($scenario);
$I->wantTo('ensure that contact works');
$contactPage = ContactPage::of($I);
$I->amOnPage(ContactPage::$URL);
$contactPage = ContactPage::openBy($I);
$I->see('Contact', 'h1');
$I->amGoingTo('submit contact form with no data');

View File

@ -4,9 +4,9 @@ use tests\functional\_pages\LoginPage;
$I = new TestGuy($scenario);
$I->wantTo('ensure that login works');
$loginPage = LoginPage::of($I);
$I->amOnPage(LoginPage::$URL);
$loginPage = LoginPage::openBy($I);
$I->see('Login', 'h1');
$I->amGoingTo('try to login with empty credentials');