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

28 lines
655 B
PHP
Raw Normal View History

<?php
namespace tests\codeception\api\_pages;
use \yii\codeception\BasePage;
/**
* Represents signup page
* @property \codeception_api\AcceptanceTester|\codeception_api\FunctionalTester $actor
*/
class SignupPage extends BasePage
{
public $route = 'site/signup';
/**
* @param array $signupData
*/
public function submit(array $signupData)
{
foreach ($signupData as $field => $value) {
$inputType = $field === 'body' ? 'textarea' : 'input';
$this->actor->fillField($inputType . '[name="SignupForm[' . $field . ']"]', $value);
}
$this->actor->click('signup-button');
}
}