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.
This commit is contained in:
Andrew Nicols
2021-01-22 14:52:17 +08:00
parent d196e8093b
commit eb03e5c7b7
@@ -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',