Blame view

tests/codeception/frontend/_pages/ContactPage.php 702 Bytes
4253cbec   root   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  <?php

  

  namespace tests\codeception\frontend\_pages;

  

  use yii\codeception\BasePage;

  

  /**

   * Represents contact page

   * @property \codeception_frontend\AcceptanceTester|\codeception_frontend\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');

      }

  }