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 2020-06-23 10:39:45 +08:00
parent 4e00a821cf
commit deaab14bf9

View file

@ -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',