From e885360f7d9df19feed2983de2c5e9046e8db20b Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 20 Feb 2015 13:46:34 +0000 Subject: [PATCH] MDL-47494 ddmarker: Fix dd qtype Behat tests to not use the generic type step. #14895 --- .../type/ddmarker/tests/behat/behat_qtype_ddmarker.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/question/type/ddmarker/tests/behat/behat_qtype_ddmarker.php b/question/type/ddmarker/tests/behat/behat_qtype_ddmarker.php index 2c4ddc060a6..cb800ccaa94 100644 --- a/question/type/ddmarker/tests/behat/behat_qtype_ddmarker.php +++ b/question/type/ddmarker/tests/behat/behat_qtype_ddmarker.php @@ -113,9 +113,13 @@ class behat_qtype_ddmarker extends behat_base { 'left' => chr(37), 'right' => chr(39), ); - $keys = str_repeat($keycodes[$direction], $repeats); list($marker, $item) = $this->parse_marker_name($marker); - $generalcontext = behat_context_helper::get('behat_general'); - $generalcontext->i_type_into_the($keys, $this->marker_xpath($marker, $item), 'xpath_element'); + $node = $this->get_selected_node('xpath_element', $this->marker_xpath($marker, $item)); + $this->ensure_node_is_visible($node); + for ($i = 0; $i < $repeats; $i++) { + $node->keyDown($keycodes[$direction]); + $node->keyPress($keycodes[$direction]); + $node->keyUp($keycodes[$direction]); + } } } -- 2.43.0