From d804067d09caa2e88f49456e0c008973532f259c Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 20 Feb 2015 13:46:54 +0000 Subject: [PATCH] MDL-47494 ddimageortext: Fix dd qtype Behat tests to not use the generic type step. #14895 --- .../type/ddimageortext/tests/behat/behat_qtype_ddimageortext.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/question/type/ddimageortext/tests/behat/behat_qtype_ddimageortext.php b/question/type/ddimageortext/tests/behat/behat_qtype_ddimageortext.php index a1a5239cd15..b5b3e947d79 100644 --- a/question/type/ddimageortext/tests/behat/behat_qtype_ddimageortext.php +++ b/question/type/ddimageortext/tests/behat/behat_qtype_ddimageortext.php @@ -77,7 +77,12 @@ class behat_qtype_ddimageortext extends behat_base { * @Given /^I type "(?P[^"]*)" on place "(?P\d+)" in the drag and drop onto image question$/ */ public function i_type_on_place_in_the_drag_and_drop_onto_image_question($keys, $placenumber) { - $generalcontext = behat_context_helper::get('behat_general'); - $generalcontext->i_type_into_the($keys, $this->drop_xpath($placenumber), 'xpath_element'); + $node = $this->get_selected_node('xpath_element', $this->drop_xpath($placenumber)); + $this->ensure_node_is_visible($node); + foreach (str_split($keys) as $key) { + $node->keyDown($key); + $node->keyPress($key); + $node->keyUp($key); + } } } -- 2.11.4.GIT