Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-1179

Implement end to end testing

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.1.2
    • Component/s: Functional tests
    • Labels:
    • Testing Instructions:
      Hide

      Set up

      1. npm install
      2. Start up the Web Driver:
        • Brower testing: node_modules/protractor/bin/webdriver-manager start
        • Device testing: node_modules/appium/bin/appium.js
      3. Prepare the test suite
        • gulp e2e-build --target browser
        • gulp e2e-build --target android --device <UUID from adb devices -l> --version <version>
      4. gulp build
      5. Build the app (ionic build android)

      Test

      1. Running the suite:
        • node_modules/protractor/bin/protractor e2e/build/protractor.conf.js

      Additional test

      1. Save the following in e2e/test.js

        describe('A user can do stuff that is cool', function() {
         
          it('Going to check a course and changing your mind', function(done) {
         
            MM.loginAs(USERS.STUDENT.LOGIN, USERS.STUDENT.PASSWORD).then(function() {
                return element(by.linkText('Psychology in Cinema')).click();
            }).then(function() {
                return element(by.linkText('Analysis')).click();
            }).then(function() {
                return element(by.linkText('Course discussion')).click();
            }).then(function() {
                expect(MM.getView().getText()).toMatch('Depiction in foreign language films');
                return MM.clickOnInSideMenu('Notifications');
            }).then(function() {
                expect(MM.getView().getText()).toMatch('There are no notifications');
                return MM.logout();
            }).then(function() {
                expect(MM.getView().getText()).toMatch('Barbara Gardner');
                done();
            });
         
          });
        });
        

      2. Re-run the suite
      Show
      Set up npm install Start up the Web Driver: Brower testing : node_modules/protractor/bin/webdriver-manager start Device testing : node_modules/appium/bin/appium.js Prepare the test suite gulp e2e-build --target browser gulp e2e-build --target android --device <UUID from adb devices -l> --version <version> gulp build Build the app (ionic build android) Test Running the suite: node_modules/protractor/bin/protractor e2e/build/protractor.conf.js Additional test Save the following in e2e/test.js describe('A user can do stuff that is cool', function() {   it('Going to check a course and changing your mind', function(done) {   MM.loginAs(USERS.STUDENT.LOGIN, USERS.STUDENT.PASSWORD).then(function() { return element(by.linkText('Psychology in Cinema')).click(); }).then(function() { return element(by.linkText('Analysis')).click(); }).then(function() { return element(by.linkText('Course discussion')).click(); }).then(function() { expect(MM.getView().getText()).toMatch('Depiction in foreign language films'); return MM.clickOnInSideMenu('Notifications'); }).then(function() { expect(MM.getView().getText()).toMatch('There are no notifications'); return MM.logout(); }).then(function() { expect(MM.getView().getText()).toMatch('Barbara Gardner'); done(); });   }); }); Re-run the suite
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE

      Description

      Setting up a system that allows for automated testing.

      We need a testing framework that supports:

      • Testing in a browser, as well as in real devices
      • Tests over all the versions that we support: 2.4 onwards
      • Tests with and without the plugin local_mobile installed
      • Identical data set on each Moodle instance across versions
      • Support for different Moodle site-wide settings

      Tools to look at are Protractor and Appium.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  27/Jul/16

                  Time Tracking

                  Estimated:
                  Original Estimate - 3 hours
                  3h
                  Remaining:
                  Remaining Estimate - 3 hours
                  3h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified