tests improved
This commit is contained in:
parent
d703b819b8
commit
1cc276076a
@ -13,10 +13,15 @@ class ContactPage extends BasePage
|
|||||||
*/
|
*/
|
||||||
public function submit(array $contactData)
|
public function submit(array $contactData)
|
||||||
{
|
{
|
||||||
$data = [];
|
foreach ($contactData as $field => $value) {
|
||||||
foreach ($contactData as $name => $value) {
|
if (in_array($field, ['name','email','subject','verifyCode'])) {
|
||||||
$data["ContactForm[$name]"] = $value;
|
$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)
|
public function login($username, $password)
|
||||||
{
|
{
|
||||||
$this->guy->submitForm('#login-form', [
|
$this->guy->fillField('input[name="LoginForm[username]"]',$username);
|
||||||
'LoginForm[username]' => $username,
|
$this->guy->fillField('input[name="LoginForm[password]"]',$password);
|
||||||
'LoginForm[password]' => $password,
|
$this->guy->click('Login','#login-form');
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user