mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-47494 qtype: Fix the behat tests for OU dd question types
This commit is contained in:
parent
96a744babd
commit
031152cc83
@ -411,6 +411,15 @@ class behat_general extends behat_base {
|
||||
list($containerselector, $containerlocator) = $this->transform_selector($containerselectortype, $containerelement);
|
||||
$destinationxpath = $this->getSession()->getSelectorsHandler()->selectorToXpath($containerselector, $containerlocator);
|
||||
|
||||
$node = $this->get_selected_node("xpath_element", $sourcexpath);
|
||||
if (!$node->isVisible()) {
|
||||
throw new ExpectationException('"' . $sourcexpath . '" "xpath_element" is not visible', $this->getSession());
|
||||
}
|
||||
$node = $this->get_selected_node("xpath_element", $destinationxpath);
|
||||
if (!$node->isVisible()) {
|
||||
throw new ExpectationException('"' . $destinationxpath . '" "xpath_element" is not visible', $this->getSession());
|
||||
}
|
||||
|
||||
$this->getSession()->getDriver()->dragTo($sourcexpath, $destinationxpath);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,6 @@ class behat_qtype_ddimageortext extends behat_base {
|
||||
* @param int $placenumber the number of the place to drop into.
|
||||
*
|
||||
* @Given /^I drag "(?P<drag_item>[^"]*)" to place "(?P<place_number>\d+)" in the drag and drop onto image question$/
|
||||
*
|
||||
*/
|
||||
public function i_drag_to_place_in_the_drag_and_drop_onto_image_question($dragitem, $placenumber) {
|
||||
$generalcontext = behat_context_helper::get('behat_general');
|
||||
|
@ -71,7 +71,6 @@ class behat_qtype_ddmarker extends behat_base {
|
||||
// DOM node so that its centre is over the centre of anothe DOM node.
|
||||
// Therefore to make it drag to the specified place, we have to add
|
||||
// a target div.
|
||||
$style =
|
||||
$session = $this->getSession();
|
||||
$session->evaluateScript("
|
||||
(function() {
|
||||
@ -88,8 +87,8 @@ class behat_qtype_ddmarker extends behat_base {
|
||||
target.style.setProperty('position', 'absolute');
|
||||
target.style.setProperty('left', xadjusted + 'px');
|
||||
target.style.setProperty('top', '{$y}px');
|
||||
target.style.setProperty('width', '0');
|
||||
target.style.setProperty('height', '0');
|
||||
target.style.setProperty('width', '1px');
|
||||
target.style.setProperty('height', '1px');
|
||||
}())");
|
||||
|
||||
$generalcontext = behat_context_helper::get('behat_general');
|
||||
|
Loading…
x
Reference in New Issue
Block a user