You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
676 B
27 lines
676 B
5 years ago
|
<?php
|
||
|
|
||
|
namespace tests\codeception\frontend\_pages;
|
||
|
|
||
|
use yii\codeception\BasePage;
|
||
|
|
||
|
/**
|
||
|
* Represents contact page
|
||
|
* @property \codeception_frontend\AcceptanceTester|\codeception_frontend\FunctionalTester $actor
|
||
|
*/
|
||
|
class ContactPage extends BasePage
|
||
|
{
|
||
|
public $route = 'site/contact';
|
||
|
|
||
|
/**
|
||
|
* @param array $contactData
|
||
|
*/
|
||
|
public function submit(array $contactData)
|
||
|
{
|
||
|
foreach ($contactData as $field => $value) {
|
||
|
$inputType = $field === 'body' ? 'textarea' : 'input';
|
||
|
$this->actor->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value);
|
||
|
}
|
||
|
$this->actor->click('contact-button');
|
||
|
}
|
||
|
}
|