MDL-51918 behat: Key press should be down-press-up
authorrajesh Taneja <rajesh@moodle.com>
Thu, 5 Nov 2015 01:15:41 +0000 (09:15 +0800)
committerrajesh Taneja <rajesh@moodle.com>
Thu, 5 Nov 2015 01:15:41 +0000 (09:15 +0800)
As we simulate real user key press event, the
event should down followed by press and then up key

lib/behat/form_field/behat_form_field.php

index aee4b4a..8e9d582 100644 (file)
@@ -106,7 +106,9 @@ class behat_form_field {
         // using the generic behat_form_field is because we are
         // dealing with a fgroup element.
         $instance = $this->guess_type();
-        return $instance->field->keyPress($char, $modifier);
+        $instance->field->keyDown($char, $modifier);
+        $instance->field->keyPress($char, $modifier);
+        $instance->field->keyUp($char, $modifier);
     }
 
     /**