From eb1335c63c5ff62257effb81d4726c841569616f Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Wed, 26 Oct 2016 10:15:59 +0800 Subject: [PATCH] MDL-55074 behat: Click on the internal div to ensure driver don't click at wrong node --- .../form/rubric/tests/behat/behat_gradingform_rubric.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 4c31b281608..6f23158b75a 100644 --- a/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php +++ b/grade/grading/form/rubric/tests/behat/behat_gradingform_rubric.php @@ -309,9 +309,10 @@ class behat_gradingform_rubric extends behat_base { $levelnode = $this->find('xpath', $selectedlevelxpath); // Using in_array() as there are only a few elements. - if (!in_array('checked', explode(' ', $levelnode->getAttribute('class')))) { + if (!$levelnode->hasClass('checked')) { + $levelnodexpath = $selectedlevelxpath . "//div[contains(concat(' ', normalize-space(@class), ' '), ' score ')]"; $this->execute('behat_general::i_click_on_in_the', - array($selectedlevelxpath, "xpath_element", $this->escape($name), "table_row") + array($levelnodexpath, "xpath_element", $this->escape($name), "table_row") ); }