Commit 9e770acd by Mark

tests improved

parent cf1fe7d2
...@@ -14,11 +14,8 @@ class ContactPage extends BasePage ...@@ -14,11 +14,8 @@ 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 ($field == 'body') { $inputType = ($field == 'body') ? 'textarea' : 'input';
$this->guy->fillField('textarea[name="ContactForm[' . $field . ']"]', $value); $this->guy->fillField($inputType.'[name="ContactForm[' . $field . ']"]', $value);
} else {
$this->guy->fillField('input[name="ContactForm[' . $field .']"]', $value);
}
} }
$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