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

Implement end to end testing

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.1.2
    • 3.1.0
    • Functional tests
    • 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
    • MOODLE_31_STABLE
    • MOODLE_31_STABLE

      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.

            dpalou Dani Palou
            fred Frédéric Massart
            Juan Leyva Juan Leyva
            Juan Leyva Juan Leyva
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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