Renamed guy classes to actors, fixed phpdoc and code style
This commit is contained in:
parent
9460b93de2
commit
3673e6c004
6
tests/codeception/.gitignore
vendored
6
tests/codeception/.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
# these files are auto generated by codeception build
|
||||
/unit/CodeGuy.php
|
||||
/functional/TestGuy.php
|
||||
/acceptance/WebGuy.php
|
||||
/unit/UnitTester.php
|
||||
/functional/FunctionalTester.php
|
||||
/acceptance/AcceptanceTester.php
|
||||
|
@ -4,6 +4,10 @@ namespace codeception\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* Represents about page
|
||||
* @property \AcceptanceTester|\FunctionalTester $actor
|
||||
*/
|
||||
class AboutPage extends BasePage
|
||||
{
|
||||
public $route = 'site/about';
|
||||
|
@ -4,6 +4,10 @@ namespace codeception\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* Represents contact page
|
||||
* @property \AcceptanceTester|\FunctionalTester $actor
|
||||
*/
|
||||
class ContactPage extends BasePage
|
||||
{
|
||||
public $route = 'site/contact';
|
||||
@ -15,8 +19,8 @@ class ContactPage extends BasePage
|
||||
{
|
||||
foreach ($contactData as $field => $value) {
|
||||
$inputType = $field === 'body' ? 'textarea' : 'input';
|
||||
$this->guy->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value);
|
||||
$this->actor->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value);
|
||||
}
|
||||
$this->guy->click('contact-button');
|
||||
$this->actor->click('contact-button');
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,10 @@ namespace codeception\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* Represents login page
|
||||
* @property \AcceptanceTester|\FunctionalTester $actor
|
||||
*/
|
||||
class LoginPage extends BasePage
|
||||
{
|
||||
public $route = 'site/login';
|
||||
@ -14,8 +18,8 @@ class LoginPage extends BasePage
|
||||
*/
|
||||
public function login($username, $password)
|
||||
{
|
||||
$this->guy->fillField('input[name="LoginForm[username]"]', $username);
|
||||
$this->guy->fillField('input[name="LoginForm[password]"]', $password);
|
||||
$this->guy->click('login-button');
|
||||
$this->actor->fillField('input[name="LoginForm[username]"]', $username);
|
||||
$this->actor->fillField('input[name="LoginForm[password]"]', $password);
|
||||
$this->actor->click('login-button');
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
|
||||
|
||||
class_name: WebGuy
|
||||
class_name: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
- PhpBrowser
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use codeception\_pages\AboutPage;
|
||||
|
||||
$I = new WebGuy($scenario);
|
||||
$I = new AcceptanceTester($scenario);
|
||||
$I->wantTo('ensure that about works');
|
||||
AboutPage::openBy($I);
|
||||
$I->see('About', 'h1');
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use codeception\_pages\ContactPage;
|
||||
|
||||
$I = new WebGuy($scenario);
|
||||
$I = new AcceptanceTester($scenario);
|
||||
$I->wantTo('ensure that contact works');
|
||||
|
||||
$contactPage = ContactPage::openBy($I);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$I = new WebGuy($scenario);
|
||||
$I = new AcceptanceTester($scenario);
|
||||
$I->wantTo('ensure that home page works');
|
||||
$I->amOnPage(Yii::$app->homeUrl);
|
||||
$I->see('My Company');
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use codeception\_pages\LoginPage;
|
||||
|
||||
$I = new WebGuy($scenario);
|
||||
$I = new AcceptanceTester($scenario);
|
||||
$I->wantTo('ensure that login works');
|
||||
|
||||
$loginPage = LoginPage::openBy($I);
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
|
||||
#basic/web/index.php
|
||||
class_name: TestGuy
|
||||
class_name: FunctionalTester
|
||||
modules:
|
||||
enabled:
|
||||
- Filesystem
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use codeception\_pages\AboutPage;
|
||||
|
||||
$I = new TestGuy($scenario);
|
||||
$I = new FunctionalTester($scenario);
|
||||
$I->wantTo('ensure that about works');
|
||||
AboutPage::openBy($I);
|
||||
$I->see('About', 'h1');
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use codeception\_pages\ContactPage;
|
||||
|
||||
$I = new TestGuy($scenario);
|
||||
$I = new FunctionalTester($scenario);
|
||||
$I->wantTo('ensure that contact works');
|
||||
|
||||
$contactPage = ContactPage::openBy($I);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$I = new TestGuy($scenario);
|
||||
$I = new FunctionalTester($scenario);
|
||||
$I->wantTo('ensure that home page works');
|
||||
$I->amOnPage(Yii::$app->homeUrl);
|
||||
$I->see('My Company');
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use codeception\_pages\LoginPage;
|
||||
|
||||
$I = new TestGuy($scenario);
|
||||
$I = new FunctionalTester($scenario);
|
||||
$I->wantTo('ensure that login works');
|
||||
|
||||
$loginPage = LoginPage::openBy($I);
|
||||
|
@ -3,4 +3,4 @@
|
||||
# suite for unit (internal) tests.
|
||||
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
|
||||
|
||||
class_name: CodeGuy
|
||||
class_name: UnitTester
|
||||
|
Loading…
Reference in New Issue
Block a user