Commit cf1fe7d2 by Mark

code fix

parent bf5bb373
...@@ -14,14 +14,12 @@ class ContactPage extends BasePage ...@@ -14,14 +14,12 @@ class ContactPage extends BasePage
public function submit(array $contactData) public function submit(array $contactData)
{ {
foreach ($contactData as $field => $value) { foreach ($contactData as $field => $value) {
if (in_array($field, ['name','email','subject','verifyCode'])) { if ($field == 'body') {
$this->guy->fillField('input[name="ContactForm[' . $field .']"]', $value); $this->guy->fillField('textarea[name="ContactForm[' . $field . ']"]', $value);
} else {
$this->guy->fillField('input[name="ContactForm[' . $field .']"]', $value);
} }
} }
if (isset($contactData['body'])) {
$this->guy->fillField('textarea[name="ContactForm[body]"]',$contactData['body']);
}
$this->guy->click('Submit','#contact-form'); $this->guy->click('Submit','#contact-form');
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment