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

Create a new step to use in moodle app behat steps to switch offline/online mode

XMLWordPrintable

    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_37_STABLE
    • MDL-65831-master
    • Hide
      Prerequisites
      1. Proper Behat setup.
      2. MDK (Optional. For easier initialisation and execution of Behat tests)
      3. Docker (It's way simpler)
      4. The local_moodlemobileapp plugin, to run our Behat tests.
      Moodle mobile app - master (latest)
      1. Launch the master version of the mobile app using docker:

        docker run --name moodlemobile-latest -p 8100:8100 moodlehq/moodlemobile2:latest

      2. Open a terminal and go to your moodle instance's "local" folder.
      3. Clone or download https://github.com/aanabit/moodle-local_moodlemobileapp Moodle Mobile app local plugin

        git clone https://github.com/aanabit/moodle-local_moodlemobileapp moodlemobileapp
        

      4. Go to the "moodlemobileapp" folder.
      5. Checkout app_behat_tests branch.

        git checkout app_behat_tests
        

      6. Edit your Moodle instance's config.php and add the following line:

        $CFG->behat_ionic_wwwroot = 'http://localhost:8100';
        

      7. Initialise your Behat environment and run the @app tests.

        mdk behat -r --tags=@app

      8. Confirm that the tests pass.
      Moodle mobile app - integration (next)
      1. Stop the "master" version of the mobile app. (e.g. "Ctrl + C" or "docker stop moodlemobile-latest" if it's running in the background)
      2. Launch the integration version of the mobile app using docker:

        docker run --name moodlemobile-next -p 8100:8100 moodlehq/moodlemobile2:next

      3. Reinitialise Behat and run again the @app tests again. If you're using MDK, you can easily do this by running:

        mdk behat --force -r --tags=@app
        

      4. Confirm that the tests pass.
      Show
      Prerequisites Proper Behat setup . MDK (Optional. For easier initialisation and execution of Behat tests) Docker (It's way simpler) The local_moodlemobileapp plugin, to run our Behat tests. Moodle mobile app - master (latest) Launch the master version of the mobile app using docker: docker run --name moodlemobile-latest -p 8100:8100 moodlehq/moodlemobile2:latest Open a terminal and go to your moodle instance's " local " folder. Clone or download https://github.com/aanabit/moodle-local_moodlemobileapp  Moodle Mobile app local plugin git clone https://github.com/aanabit/moodle-local_moodlemobileapp moodlemobileapp Go to the " moodlemobileapp " folder. Checkout  app_behat_tests branch. git checkout app_behat_tests Edit your Moodle instance's config.php and add the following line: $CFG->behat_ionic_wwwroot = 'http://localhost:8100'; Initialise your Behat environment and run the @app tests. mdk behat -r --tags=@app Confirm that the tests pass. Moodle mobile app - integration (next) Stop the "master" version of the mobile app. (e.g. " Ctrl + C " or " docker stop moodlemobile-latest " if it's running in the background) Launch the integration version of the mobile app using docker: docker run --name moodlemobile-next -p 8100:8100 moodlehq/moodlemobile2:next Reinitialise Behat and run again the @app tests again. If you're using MDK, you can easily do this by running: mdk behat --force -r --tags=@app Confirm that the tests pass.
    • Moppies Moodle 3.8 Sprint 1, Moppies Moodle 3.8 Sprint 2, Moppies Moodle 3.8 Sprint 3, Moppies Moodle 3.8 Sprint 4

      A new 'appProvider.setForceOffline(bool)' function has been exported to change a flag for moodle app behats to be able to simulate offline mode activity.

      This function is available from Moodle app 3.7 upwards.

      A new step would be created to use and change the value of that flag in Behat tests.

            amaia Amaia Anabitarte
            amaia Amaia Anabitarte
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Jun Pataleta Jun Pataleta
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 25 minutes
                2d 25m

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