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
696B

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