diff --git a/question/type/ddwtos/tests/behat/behat_qtype_ddwtos.php b/question/type/ddwtos/tests/behat/behat_qtype_ddwtos.php index 4265ceb2bd5..82ec8676eea 100644 --- a/question/type/ddwtos/tests/behat/behat_qtype_ddwtos.php +++ b/question/type/ddwtos/tests/behat/behat_qtype_ddwtos.php @@ -76,7 +76,12 @@ class behat_qtype_ddwtos extends behat_base { * @Given /^I type "(?P[^"]*)" into space "(?P\d+)" in the drag and drop onto image question$/ */ public function i_type_into_space_in_the_drag_and_drop_into_text_question($keys, $spacenumber) { - $generalcontext = behat_context_helper::get('behat_general'); - $generalcontext->i_type_into_the($keys, $this->drop_xpath($spacenumber), 'xpath_element'); + $node = $this->get_selected_node('xpath_element', $this->drop_xpath($spacenumber)); + $this->ensure_node_is_visible($node); + foreach (str_split($keys) as $key) { + $node->keyDown($key); + $node->keyPress($key); + $node->keyUp($key); + } } }