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

Hard to reference reportbuilder tables in behat

    XMLWordPrintable

Details

    • MOODLE_403_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80912-402
    • MDL-80912-403
    • Hide

      Caption changes

      1. Covered by Behat (nothing to do manually)

      Download filename

      1. Log in as admin
      2. Navigate to Reports in user menu
      3. Create a report
      4. Close editor to return to list of reports
      5. Edit the following file:

        reportbuilder/classes/local/systemreports/reports_list.php
        

      6. Change the $this->set_downloadable(...) call to:

        $this->set_downloadable(true);
        

      7. Reload list of reports
      8. Download the report, confirm filename is Reports list.<extension>
      9. Re-edit the same file as before, change the $this->set_downloadable(...) call to:

        $this->set_downloadable(true, 'Rabbits');
        

      10. Reload list of reports
      11. Download the report, confirm filename is Rabbits.<extension>
      Show
      Caption changes Covered by Behat (nothing to do manually) Download filename Log in as admin Navigate to Reports in user menu Create a report Close editor to return to list of reports Edit the following file: reportbuilder/classes/local/systemreports/reports_list.php Change the $this->set_downloadable(...) call to: $this->set_downloadable(true); Reload list of reports Download the report, confirm filename is Reports list.<extension> Re-edit the same file as before, change the $this->set_downloadable(...) call to: $this->set_downloadable(true, 'Rabbits'); Reload list of reports Download the report, confirm filename is Rabbits.<extension>

    Description

      We have several system reports on the same page in Workplace. We want to use a step

      @Then /^the following should exist in the "(?P<table_string>[^"]*)" table:$/
      

      However we can point it to the second or third reportbuilder table on the page. They all have the same CSS class, no id or caption and the current xpath for the table selector is not flexible enough:

              , 'table' => <<<XPATH
      .//table[(./@id = %locator% or contains(.//caption, %locator%) or contains(.//th, %locator%) or contains(concat(' ', normalize-space(@class), ' '), %locator% ))]
      XPATH
      

      I would like to propose one of the following solutions:

      • in the core_reportbuilder api allow to add classes or id or caption to the table (edited by MG to reflect the actual solution)
      • OR in the xpath for the 'table' add an option to look for a table that is inside the element with a given id/class (this can be done only for RB tables)

      Suggestions are welcome. Thanks

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              marina Marina Glancy
              Carlos Castillo Carlos Castillo
              David Carrillo David Carrillo
              Kim Jared Lucas Kim Jared Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 40 minutes
                  3h 40m

                  Clockify

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