Mark 12 年之前
父節點
當前提交
e877a23aad
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      tests/_pages/ContactPage.php

+ 4 - 6
tests/_pages/ContactPage.php

@@ -14,14 +14,12 @@ class ContactPage extends BasePage
 	public function submit(array $contactData)
 	{
 		foreach ($contactData as $field => $value) {
-			if (in_array($field, ['name','email','subject','verifyCode'])) {
-				$this->guy->fillField('input[name="ContactForm[' . $field .']"]', $value);
+			if ($field == 'body') {
+				$this->guy->fillField('textarea[name="ContactForm[' . $field . ']"]', $value);
+			} else {
+				$this->guy->fillField('input[name="ContactForm[' . $field .']"]', $value);				
 			}
 		}
-		
-		if (isset($contactData['body'])) {
-			$this->guy->fillField('textarea[name="ContactForm[body]"]',$contactData['body']);
-		}
 		$this->guy->click('Submit','#contact-form');
 	}
 }