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.

ContactPage.php 676B

8 yıl önce
1234567891011121314151617181920212223242526
  1. <?php
  2. namespace tests\codeception\frontend\_pages;
  3. use yii\codeception\BasePage;
  4. /**
  5. * Represents contact page
  6. * @property \codeception_frontend\AcceptanceTester|\codeception_frontend\FunctionalTester $actor
  7. */
  8. class ContactPage extends BasePage
  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. }