Commit bf5bb373 by Mark

tests improved

parent 81f36ec2
......@@ -13,10 +13,15 @@ class ContactPage extends BasePage
*/
public function submit(array $contactData)
{
$data = [];
foreach ($contactData as $name => $value) {
$data["ContactForm[$name]"] = $value;
foreach ($contactData as $field => $value) {
if (in_array($field, ['name','email','subject','verifyCode'])) {
$this->guy->fillField('input[name="ContactForm[' . $field .']"]', $value);
}
}
$this->guy->submitForm('#contact-form', $data);
if (isset($contactData['body'])) {
$this->guy->fillField('textarea[name="ContactForm[body]"]',$contactData['body']);
}
$this->guy->click('Submit','#contact-form');
}
}
......@@ -14,9 +14,8 @@ class LoginPage extends BasePage
*/
public function login($username, $password)
{
$this->guy->submitForm('#login-form', [
'LoginForm[username]' => $username,
'LoginForm[password]' => $password,
]);
$this->guy->fillField('input[name="LoginForm[username]"]',$username);
$this->guy->fillField('input[name="LoginForm[password]"]',$password);
$this->guy->click('Login','#login-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