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.

28 line
670B

  1. <?php
  2. namespace tests\codeception\frontend\_pages;
  3. use \yii\codeception\BasePage;
  4. /**
  5. * Represents signup page
  6. * @property \codeception_frontend\AcceptanceTester|\codeception_frontend\FunctionalTester $actor
  7. */
  8. class SignupPage extends BasePage
  9. {
  10. public $route = 'site/signup';
  11. /**
  12. * @param array $signupData
  13. */
  14. public function submit(array $signupData)
  15. {
  16. foreach ($signupData as $field => $value) {
  17. $inputType = $field === 'body' ? 'textarea' : 'input';
  18. $this->actor->fillField($inputType . '[name="SignupForm[' . $field . ']"]', $value);
  19. }
  20. $this->actor->click('signup-button');
  21. }
  22. }