Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77092

Behat: Expand all fieldsets step does not work with single fieldset


      The bug described in MDL-75608 has been reintroduced: the 'Expand all fieldsets' step in Behat fails when there is a single fieldset.

      It is looking for the following xpath:

      //legend/div[contains(concat(' ', @class, ' '), ' ftoggler ')]//a[contains(concat(' ', @class, ' '), ' icons-collapse-expand ') and @aria-expanded = 'false']

      Or to put it in CSS syntax which is easier to read,

      legend > div.ftoggler a.icons-collapse-expand[aria-expanded=false]

      However, the 'legend' tag is now screenreader-only (I'm told this change was in MDL-74814), and this div is not within the legend. It now looks like this:

      fieldset > div > div.ftoggler a.icons-collapse-expand[aria-expanded=false]

      The following would match both the old and new situations and is generally looser, which is probably safer regarding potential custom themes, with the only risk being if somebody uses 'ftoggler' somewhere inside a form (except for these fieldset expanders) it might very rarely do the wrong thing:

      fieldset div.ftoggler a.icons-collapse-expand[aria-expanded=false]

      //fieldset//div[contains(concat(' ', @class, ' '), ' ftoggler ')]//a[contains(concat(' ', @class, ' '), ' icons-collapse-expand ') and @aria-expanded = 'false']

      I will do another fix. This time I will also incorporate the Behat test so that we can stop breaking it in future...

            quen Sam Marshall
            quen Sam Marshall
            Katie Ransom Katie Ransom
            Simey Lameze Simey Lameze
            CiBoT CiBoT
            0 Vote for this issue
            5 Start watching this issue


                Original Estimate - Not Specified
                Not Specified
                Remaining Estimate - 0 minutes
                Time Spent - 2 hours, 5 minutes
                2h 5m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.