MDL-55074 behat: Click on the internal div to ensure driver don't click at wrong node

This commit is contained in:
Rajesh Taneja 2016-10-26 10:15:59 +08:00
parent 7f8c9bb852
commit eb1335c63c
No known key found for this signature in database
GPG Key ID: B363F7FB787F80E4

View File

@ -309,9 +309,10 @@ class behat_gradingform_rubric extends behat_base {
$levelnode = $this->find('xpath', $selectedlevelxpath); $levelnode = $this->find('xpath', $selectedlevelxpath);
// Using in_array() as there are only a few elements. // 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', $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")
); );
} }