Skip to content

Commit

Permalink
MDL-53810 behat: Zoom in Rubric before filling form.
Browse files Browse the repository at this point in the history
div is now overflow, selenium can't get element
in viewport, zoom in before entering the value
  • Loading branch information
Rajesh Taneja authored and andrewnicols committed May 6, 2016
1 parent a8abd53 commit c5fe77f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php
Expand Up @@ -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) {

Expand Down Expand Up @@ -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'));
}
}

/**
Expand Down

0 comments on commit c5fe77f

Please sign in to comment.