From 472ac2d39033b9d1ed72d5885ea933ed784ffadd Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Wed, 3 Aug 2016 10:22:58 +0800 Subject: [PATCH] MDL-55355 mod_feedback: Change show chart data step to avoid errors --- mod/feedback/tests/behat/behat_mod_feedback.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/feedback/tests/behat/behat_mod_feedback.php b/mod/feedback/tests/behat/behat_mod_feedback.php index 5c46245057e..1f0a898240b 100644 --- a/mod/feedback/tests/behat/behat_mod_feedback.php +++ b/mod/feedback/tests/behat/behat_mod_feedback.php @@ -138,14 +138,15 @@ class behat_mod_feedback extends behat_base { $feedbackxpath = "//th[contains(normalize-space(string(.)), \"" . $feedbackname . "\")]/ancestor::table/" . "following-sibling::div[contains(concat(' ', normalize-space(@class), ' '), ' chart-area ')][1]" . - "//p[contains(concat(' ', normalize-space(@class), ' '), ' chart-table-expand ')]"; + "//p[contains(concat(' ', normalize-space(@class), ' '), ' chart-table-expand ') and ". + "//a[contains(normalize-space(string(.)), '".get_string('showchartdata')."')]]"; $charttabledataxpath = $feedbackxpath . "/following-sibling::div[contains(concat(' ', normalize-space(@class), ' '), ' chart-table-data ')][1]"; // If chart data is not visible then expand. $node = $this->get_selected_node("xpath_element", $charttabledataxpath); - if (!$node->isVisible()) { + if ($node && !$node->isVisible()) { $this->execute('behat_general::i_click_on_in_the', array( get_string('showchartdata'), 'link',