From eb03e5c7b7f4eeef38c9b4aa417ef187c4e6b5e8 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 23 Jun 2020 10:39:45 +0800 Subject: [PATCH] MDL-66979 mod_data: Improve behat chart data step Charts data visibility is more reliable when checked via the aria-expanded attribute. The isVisible attribute can cause some failures under Firefox. --- mod/feedback/tests/behat/behat_mod_feedback.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mod/feedback/tests/behat/behat_mod_feedback.php b/mod/feedback/tests/behat/behat_mod_feedback.php index e95581de263..23bf53a12f1 100644 --- a/mod/feedback/tests/behat/behat_mod_feedback.php +++ b/mod/feedback/tests/behat/behat_mod_feedback.php @@ -165,9 +165,7 @@ class behat_mod_feedback extends behat_base { // If chart data is not visible then expand. $node = $this->get_selected_node("xpath_element", $charttabledataxpath); if ($node) { - if (!$node->isVisible()) { - // Focus on node, before checking if it's visible. - $node->focus(); + if ($node->getAttribute('aria-expanded') === 'false') { $this->execute('behat_general::i_click_on_in_the', array( get_string('showchartdata'), 'link',