Commit 19fa5cb3 by Qiang Xue

Merge pull request #2353 from Ragazzo/tests_improved

tests improved
parents beafb99e 9e770acd
......@@ -13,10 +13,10 @@ class ContactPage extends BasePage
*/
public function submit(array $contactData)
{
$data = [];
foreach ($contactData as $name => $value) {
$data["ContactForm[$name]"] = $value;
foreach ($contactData as $field => $value) {
$inputType = ($field == 'body') ? 'textarea' : 'input';
$this->guy->fillField($inputType.'[name="ContactForm[' . $field . ']"]', $value);
}
$this->guy->submitForm('#contact-form', $data);
$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