accounts/tests/codeception/api/_pages/ContactPage.php

27 lines
631 B
PHP
Raw Normal View History

<?php
namespace tests\codeception\api\_pages;
use yii\codeception\BasePage;
/**
* Represents contact page
* @property \tests\codeception\api\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');
}
}