MDL-49205 behat: fix I set the field with xpath fail message.

This commit is contained in:
Tim Hunt
2015-02-13 16:16:27 +00:00
parent cfab858010
commit 2a7241b3a1
+1 -5
View File
@@ -165,11 +165,7 @@ class behat_forms extends behat_base {
* @return void
*/
public function i_set_the_field_with_xpath_to($fieldxpath, $value) {
try {
$fieldNode = $this->find('xpath', $fieldxpath);
} catch (\Behat\Mink\Exception\ElementNotFoundException $e) {
throw new ElementNotFoundException('Field with xpath ' . $fieldxpath . 'not found, so can\'t be set');
}
$fieldNode = $this->find('xpath', $fieldxpath);
$field = behat_field_manager::get_form_field($fieldNode, $this->getSession());
$field->set_value($value);
}