2016-01-02 19:13:18 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace tests\codeception\api\_pages;
|
|
|
|
|
|
|
|
use yii\codeception\BasePage;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents contact page
|
2016-01-15 14:51:27 +05:30
|
|
|
* @property \tests\codeception\api\FunctionalTester $actor
|
2016-01-02 19:13:18 +05:30
|
|
|
*/
|
2016-01-15 14:51:27 +05:30
|
|
|
class ContactPage extends BasePage {
|
|
|
|
|
2016-01-02 19:13:18 +05:30
|
|
|
public $route = 'site/contact';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array $contactData
|
|
|
|
*/
|
2016-01-15 14:51:27 +05:30
|
|
|
public function submit(array $contactData) {
|
2016-01-02 19:13:18 +05:30
|
|
|
foreach ($contactData as $field => $value) {
|
|
|
|
$inputType = $field === 'body' ? 'textarea' : 'input';
|
|
|
|
$this->actor->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value);
|
|
|
|
}
|
|
|
|
$this->actor->click('contact-button');
|
|
|
|
}
|
2016-01-15 14:51:27 +05:30
|
|
|
|
2016-01-02 19:13:18 +05:30
|
|
|
}
|