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

File upload with filemanager not working on settings pages with behat

    XMLWordPrintable

    Details

      Description

      I believe the problem is in the behat_theme_boost_behat_repository_upload->get_filepicker_node().

      Conditions for the test to fail:

      • the filemanager needs to be on a settings.php
      • using a theme based on boost, basically using the behat_theme_boost_behat_repository_upload->get_filepicker_node()

      Basically the 

      //input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" .
      "//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' felement ')]
      

      xpath will find nothing because there is no "felement" class on the wrapper div when a filemanager is on a settings.php.

      So reproduction steps are:

      • in config.php set $CFG->theme = 'boost';
      • in a .feature file: 

      @javascript
      Scenario: configstoredfile test
        When I log in as "admin"
        Then I navigate to "Appearance > Logos" in site administration
        And I upload "xyz test file" file to "Logo" filemanager
      

       This should end with:

      "Logo" filepicker can not be found (Behat\Mink\Exception\ExpectationException)
      

      I think moodle currently does not have any test for file upload located on a settings.php (at least I did not find any), probably thats why nobody run into this. OR I seriously overlooked something, thats also a possibility, in that case please enlighten me.

        Attachments

          Activity

            People

            Assignee:
            kosswa Kathrin Osswald
            Reporter:
            pétercsonka Péter Csonka
            Peer reviewer:
            Luca Bösch
            Integrator:
            Andrew Nicols
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jan/20

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 53 minutes
                53m