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

Allow Behat testing of mobile app features and plugins

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Follow the instructions at the documentation link to configure your Moodle, Behat, and Moodle mobile environments. Initially, set only $CFG->behat_approot and not $CFG->behat_ionicaddress.
      2. Run Behat with the --tags=app command-line option.
        • EXPECTED: The test will get a few dots in, then take a several-minute pause, then eventually pass. During the test you should see a number of mobile app features being exercised.
      3. After the test, check there are no stray giant 'node' or 'ionic' processes still running (e.g. on Unix-based platforms you could do: ps -ax | grep node, ps -ax | grep ionic).
      4. Manually run 'ionic serve -b' in the app development area
      5. Change config.php to specify $CFG->behat_ionicaddress
      6. Run the test again
        • EXPECTED: The test should pass in the same way but without the large delay (because you already waited for Ionic to start).
      Show
      Follow the instructions at the documentation link to configure your Moodle, Behat, and Moodle mobile environments. Initially, set only $CFG->behat_approot and not $CFG->behat_ionicaddress. Run Behat with the --tags=app command-line option. EXPECTED: The test will get a few dots in, then take a several-minute pause, then eventually pass. During the test you should see a number of mobile app features being exercised. After the test, check there are no stray giant 'node' or 'ionic' processes still running (e.g. on Unix-based platforms you could do: ps -ax | grep node, ps -ax | grep ionic). Manually run 'ionic serve -b' in the app development area Change config.php to specify $CFG->behat_ionicaddress Run the test again EXPECTED: The test should pass in the same way but without the large delay (because you already waited for Ionic to start).
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-63977-beforemerge

      Description

      This improvement allows testing of mobile app features and plugins using Behat in the same way as any other Moodle feature.

      In order to do the testing you will need a developer setup of the mobile app, and to configure this in your config.php. The actual testing will take place in Chrome using the Ionic dev server.

      This is fully documented here:
      https://docs.moodle.org/dev/Acceptance_testing_for_the_mobile_app

      This approach is a good solution for plugin testing. It is probably also a good option for testing features built in to the app, although a disadvantage in that situation is that test scripts for the app need to live within Moodle source. See documentation above for more about that - it might need future enhancement.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Mark Johnson
              Integrator:
              Andrew Nicols
              Tester:
              Andrew Nicols
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              5 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/May/19