tests improved
This commit is contained in:
parent
d703b819b8
commit
1cc276076a
@ -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');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user