Skip to content

Commit

Permalink
MDL-73489 Quiz: Fix incorrect XPath for custom Behat step
Browse files Browse the repository at this point in the history
  • Loading branch information
HuongNV13 committed Mar 15, 2022
1 parent 967d9b2 commit 76360c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod/quiz/tests/behat/behat_mod_quiz.php
Expand Up @@ -435,7 +435,8 @@ public function i_open_the_add_to_quiz_menu_for($pageorlast) {
*/
public function i_should_see_on_quiz_page($questionname, $pagenumber) {
$xpath = "//li[contains(., '" . $this->escape($questionname) .
"')][./preceding-sibling::li[contains(., 'Page " . $pagenumber . "')]]";
"')][./preceding-sibling::li[contains(@class, 'pagenumber')][1][contains(., 'Page " .
$pagenumber . "')]]";

$this->execute('behat_general::should_exist', array($xpath, 'xpath_element'));
}
Expand Down

0 comments on commit 76360c2

Please sign in to comment.