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

Use ID to identify data field in default_activity_completion.feature

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-80243-403
    • MDL-80243-main
    • Hide

      Setup

      1. Install the Aspire resource list plugin:

        git clone https://github.com/tonyjbutler/moodle-mod_aspirelist.git mod/aspirelist

      2. Until MDL-80302 is fixed, the following patch needs to be added (otherwise, the test will fail) in the completion/classes/defaultedit_form.php file: https://gist.github.com/sarjona/0a09a42a052dbe377dd9caead9602a4b (you'll need to edit this file and manually add these changes).

       

      Testing

      1. Init Behat and Selenium.
      2. Run the following scenario "Edit default activity completion rules for assignment"
      3. Ensure it passes.
      Show
      Setup Install the Aspire resource list plugin: git clone https: //github.com/tonyjbutler/moodle-mod_aspirelist.git mod/aspirelist Until MDL-80302 is fixed, the following patch needs to be added (otherwise, the test will fail) in the completion/classes/defaultedit_form.php file: https://gist.github.com/sarjona/0a09a42a052dbe377dd9caead9602a4b (you'll need to edit this file and manually add these changes).   Testing Init Behat and Selenium. Run the following scenario "Edit default activity completion rules for assignment" Ensure it passes.

      Currently the default_activity_completion.feature uses the name ("Add requirements") to identify the data field for mod_assign, which is fine if mod_assign is the 1st module.

      In case another module plugin precedes mod_assign alphabetically (e.g. mod_aspirelist)  the data field name refers to the wrong data field and the test will fail with the error

      TypeError: rect is undefined (Facebook\WebDriver\Exception\UnknownErrorException)

      This can be fixed by using the ID to identify the data field instead of the field name.

      Line 33 of completion/tests/behat/default_activity_completion.feature should change from 

      | Add requirements | 1 |

      to

      | id_completion_assign_2 | 1 |  

       

      To recreate the issue:

      Install a vanilla Moodle 4.3

      Install master branch of mod_aspirelist from https://github.com/tonyjbutler/moodle-mod_aspirelist.git

      Run core Behat test for completion/tests/behat/default_activity_completion.feature

      You should see the aforementioned error.

            lameze Simey Lameze
            opitz Matthias Opitz
            Angelia Dela Cruz Angelia Dela Cruz
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 10 minutes
                1d 1h 10m

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