From c5fe77ffe400fc5917224ea30c933572a5dce3a2 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 5 May 2016 14:48:28 +0800 Subject: [PATCH] MDL-53810 behat: Zoom in Rubric before filling form. div is now overflow, selenium can't get element in viewport, zoom in before entering the value --- .../rubric/tests/behat/behat_gradingform_rubric.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php b/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php index e0d32990ce197..4c31b281608e6 100644 --- a/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php +++ b/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php @@ -281,6 +281,11 @@ public function i_grade_by_filling_the_rubric_with(TableNode $rubric) { $stepusage = '"I grade by filling the rubric with:" step needs you to provide a table where each row is a criterion' . ' and each criterion has 3 different values: | Criterion name | Number of points | Remark text |'; + // If running Javascript, ensure we zoom in before filling the grades. + if ($this->running_javascript()) { + $this->execute('behat_general::click_link', get_string('togglezoom', 'mod_assign')); + } + // First element -> name, second -> points, third -> Remark. foreach ($criteria as $name => $criterion) { @@ -326,6 +331,11 @@ public function i_grade_by_filling_the_rubric_with(TableNode $rubric) { $textarea = $this->get_node_in_container('css_element', 'textarea', 'table_row', $name); $this->execute('behat_forms::i_set_the_field_to', array($textarea->getAttribute('name'), $criterion[1])); } + + // If running Javascript, then ensure to close zoomed rubric. + if ($this->running_javascript()) { + $this->execute('behat_general::click_link', get_string('togglezoom', 'mod_assign')); + } } /**