Improve End-to-End Testing in the Mobile App
GSoC 2017 Project Proposal for Moodle
Personal Details
Student Name : Diwakar Moturu
Email Id : diwakar03121997@gmail.com
GitHub : magician03 [➚]
Moodle Tracker : magician03 [➚]
WebPage : magician03.github.io [➚]
Skype : diwakar03121997
Timezone : ASIA/KOLKATA | GMT+05:30 I INDIA
Project Description
The project aims to enable the Moodle Mobile App with fully automated End-to-End testing capabilities with SauceLabs and Travis CI using latest upgraded versions of Node, Protractor, Gulp, Appium, Selenium with latest Moodle Mobile App v3.3.0 [~15/5/2017].
Integrating SauceLabs and TravisCI enables a completely automated build on Travis along with End-to-End testing on SauceLabs’ Browsers, Mobile/Tablet Android Emulators, Mobile/Tablet iOS Simulators [and Real Devices exclusively for premium users]. Incase of any failure in Travis build, debugging can be easily done as SauceLabs provides the actual video and screenshot logs of all the tests for 30 days [only metadata & screenshots after that] and TravisCI restores the build log for lifetime of a repository.
Project Goals
- Upgrade Node, Protractor, Gulp, Appium and other related dependencies of App codebase [in package.json] [MOBILE-1796➚, currently resolved and integrated]
- Configure the App for Travis build and SauceLabs testing via Travis
- Fix all the failing E2E tests
- Update the e2e/lib.js file, replace deprecated protractor functions with new ones like ExpectedConditions, wait and others
- Configure e2e/plugins/wait_for_transition.js file to work accordingly
- Modify the existing 40 E2E TestSuites[ Ref:1➚ ] to pass on SauceLabs via Travis build
- Add E2E tests for newly added features/modules[ Ref:2➚ ] in Moodle Mobile v3.1.x, v3.2.x, v3.3.0 [for releases post-summer 2016 - May 29th 2017]
- Modify the existing documentation of Moodle Mobile Development Environment Setup and End-to-End testing environment
- Remove Unit Tests, Karma [ Ref:3➚ ] and related dependencies ( optional )
- Encapsulate the Development Environment setup ( optional )
- Rename ionic project, deprecate Ionic cli v1, migrate to Ionic cli v2 (optional )
- Future Developments [ Post GSoC ] : Update the TestSuites regularly to test out latest features before the release of new versions ( additional )
Work done to date
I have set the Moodle Mobile Development environment and End-to-End testing environment on my local system and have completed the following tasks :
- Upgraded Node, Protractor, Gulp, Appium and other related dependencies
- Configured the App for successful Travis build and SauceLabs testing via Travis [in my fork and personal SauceLabs account]
- Fixed e2e/lib.js file with latest Protractor features like ExpectedConditions, wait, and others
- Configured e2e/plugins/wait_for_transition.js file for its usage
- Fixed mod_assign.spec.js test suite which contains 5 tests
- Extended “Add Submission” to test “File attachment” feature in mod_assign.spec.js [ new feature in v3.1.2 ]
Proof of work
GitHub Branch name - e2e [➚]
Git Diff Url with moodlehq/moodlemobile2:master - [➚]
Travis Build Log [with SauceLabs Testing] - Successful and Passed [➚]
SauceLabs Logs** [ 5 Tests | 1 TestSuite ]
- Android Emulator Logs : [1 - ➚] [2 - ➚] [3 - ➚] [4 - ➚] [5 - ➚]
- Browser Logs : [1 - ➚] [2 - ➚] [3 - ➚] [4 - ➚] [5 - ➚]
- iOS Simulator Logs : .ipa file not available publicly, could not test on iOS
[ ** - SauceLabs video and runtime logs are available for only 30 days. Only MetaData and runtime screenshots will be restored after that. All the above tests were run on 19-March-2017 ]
Minimum Requirements
Moodle Mobile Tracker Issues
I am regular contributor[➚] of Moodle Mobile since late Dec 2016. Some of the significant issues I have resolved [with guidance from Juan Leyva, Daniel Palou, Pau Ferrer] :
- MOBILE-1512[➚] Add Module Prefetch Info in Context Menu for all Modules
- MOBILE-1157[➚] Add Title, Description in all Resource Modules from Module Prefetch
- MOBILE-1789[➚] Add Message Search functionality via WS
- MOBILE-1955[➚] Increase the size & padding of some icons
- MOBILE-2050[➚] Modify the font-size of headlines in .item mm-format-text
- MOBILE-1843[➚] Quick fix for Dev Env Setup failure, Appium Issue
Some of these have been integrated in v3.2.1 and rest are likely to be integrated in v3.3.0. Apart from these, I have also commented my suggestions, earlier, on this project in MOBILE-1864[➚]. This experience made me familiar with Development work flow, coding styles and other best practices followed by Moodle Mobile Team. Along with this and my ‘Work done to date’ [➚] , I am confident that I can successfully complete this project.
Custom App [with additional page in sidemenu]
- Branch & Diff on personal fork for the work : custom-mm2[➚] & Diff [➚]
- Commit for sidemenu changes [add item with a custom page] : [ ➚ ]
- Phonegap build repo : phonegap-mm2 [ ➚ ]
[ Phonegap build is successful. Apk generated. Unfortunately, not installing on device. This is a common issue faced by many as mentioned in this[➚] forum thread. The sidemenu changes have been successfully applied and can be tested in browser. I have also tried to fix the learn-moodle branch of phonegap-build repo. More info about it here[➚] ]
Project Timeline
Community Bonding Period [May 5 - May 29]
[ Note : I’ll be having my End-Semester exams during 1st week of this period. I’ll be working for maximum of 1 Hr during the 1st week. To compensate this loss, I’ll be working on weekends and extra time during the rest of community bonding period. I will also start the coding work a week prior to proposed timeline as my summer break starts way earlier than May 30 and the extra time towards the end could serve as buffer ]
- Create a Team Account for Moodle Mobile under SauceLabs OpenSauce plan
- Configure Environment variables of TravisCI to add Sauce credentials
- Understand the App code base and its functioning thoroughly
- Learn and implement all the latest features of Protractor
- Choose apt Devices, Emulators, Simulators of SauceLabs after rigorous sample testing
- Get the .apk and .ipa files of Moodle Mobile’s latest release v3.3.0 [~15/05/2017] from mentor
- Note down the newly added features in Moodle Mobile v3.1.x, v3.2.x, v3.3.0 from release notes and linked Tracker issues of respective versions that needs to be included in End-to-End testing
- Note down the reasons for failure of existing 40 E2E Test Suites
- Upload the .apk and .ipa files to sauce-storage for Appium testing
Part A, Phase - 1 [May 30 - June 12]
- Generate required Android, iOS, Browser conf files enabling SauceLabs Selenium Address, Travis Tunnel Number, Travis Job Number, sauce-storage details for .apk & .ipa files along with SauceLabs credentials
- Update travis.yml file to connect to SauceLabs SauceConnect Proxy Tunnel to run new config test files
- Upgrade Node, Appium, Gulp, Protractor, Appium and other related dependencies
- Fix lib.js and wait_for_transition.js files with latest protractor functions and add new functions like Context Menu Operations[for modules], ScrollToBottom, etc
- Remove Karma, Unit tests and its other dependencies ( optional )
- Rename ionic project, deprecate Ionic cli v1, migrate to Ionic cli v2 ( optional )
- Encapsulate the Development Environment setup ( optional )
Part B, Phase - 1 [June 13 - June 25]
- Start fixing failing TestSuites, complete 16-18 of failing TestSuites [ Ref:1➚ ]
- Debug all Modules, Course-Specific, Teacher and other TestSuites
- Run all of the corrected TestSuites in SauceLabs in iOS, Android and Browser via Travis
Phase - 1 Evaluations & Buffer time [June 26 - June 30]
- Submit the code
- Complete the pending deliverables (if any)
- Edit/Modify the code according to mentor suggestions and review
Part A, Phase - 2 [July 1 - July 12]
- Fix remaining 10-12 TestSuites [ Ref:1 ➚ ]
- Debug Course, Contacts, Calendar, Login, Settings, Files, Notifications and other Test Suites
- Start coding tests for newly added features [ Ref:2 ➚ ]
- Run all TestSuites in SauceLabs in iOS, Android and Browser via Travis
Part B, Phase - 2 [July 12 - July 23]
- Code tests for newly added features [ Ref:2 ➚ ]
- Code Tests for Messaging, Profile Section Badges, Signup, Notifications & Message preferences, Context Menu functionalities and other newly added features
- Integrate them with earlier Suites and run on SauceLabs via Travis
Phase - 2 Evaluations & Buffer time [July 24 - July 28]
- Submit the code
- Complete the pending deliverables (if any)
- Edit/Modify the code according to mentor suggestions and review
[ Note : During this period, my college re-opens and I need 2-3 days of time for travel, course registrations and other formalities. To compensate any loss, I’ll be working on weekends and extra time in Phase-2&3 ]
Part A, Phase - 3 [July 29 - August 9]
- Code tests for Lesson, Feedback, Database modules [new in v3.3.0, yet to be released]
- Code tests for other newly added features [ Ref:2 ➚ ]
- Integrate them with earlier Suites and run on SauceLabs
Part B, Phase - 3 [August 10 - August 20]
- Seek code review from mentor
- Update the documentation of Moodle Mobile Development Environment Setup
- Update the documentation of Moodle Mobile End-to-End Testing Environment
- Edit/Modify Code according to mentor suggestions
- Thorough testing in SauceLabs and Travis CI Build
Final Code Submission & Student Evaluations [August 21 - August 29]
- Give one last run of all TestSuites on SauceLabs via Travis build
- Final code submission
The above mentioned timeline is flexible and is subject to changes according to mentor suggestions and other factors during the community bonding period. I will be dedicating 40-50 hours per week during the development period and stay in touch with mentor regularly. GSoC, Moodle are my only commitments during the timeline. I will also start a GSoC journal blog and will be updating the work done, things learnt regularly after every Part/Phase.
Post GSoC period
After the completion of GSoC Development period & Evaluations, I’ll contribute towards smooth integration of the project into moodlehq/moodlemobile2:master codebase, update the code consistently with latest features and regular maintenance checks.
Open-Source Development Experience
- Regular contributor of Moodle Mobile since late Dec 2016, fixed 5-6 Issues [➚] , also created and given my suggestions on various Issues in Moodle Mobile Tracker [➚]
- Active member and contributor at FOSS-IIITA [➚] [ Open-Sources Society of IIITA ] since April 2016
- Mentored students at OpenCode[➚] [ Nation-wide Open Source event by FOSS-IIITA ]
- Contributed [and/or raised Issues] in various other Open-Source organisations like FOSS-ASIA, Harp and others
- All my Personal & Collaborated projects are hosted on my GitHub [➚]
Projects/Work Experience [Software Development related]
Projects
- Gather : Cross-Platform event organization web app that allows users to create, attend & view the events around their location. Web/Android/Messenger-bot [ Project - ➚ ]
- BlogSpace : Blogging platform built upon Google App Engine, Google Cloud Platform, Google WebApp2 where users can post their articles in their blogs, and later showcased to all other users in their feed. [ Project - ➚ ]
- Peer-to-Peer Chat Service : Peer to Peer chat service where users can communicate securely in group or one-to-one. No logs. No signup. CLI version. [ Project - ➚ ]
- Youtube-Instant : Web App to browse and search YouTube instantly inspired from Google Instant Search. [ Project - ➚ ]
- Finance & Trading : Web App that lets its users to trade, quote stocks using Yahoo Finance API [ Course project of Harvard CS50➚, codebase should not be made public ]
- Online Judge : Google Code Jam style online Judge built in 5 hrs for Intra-College competition [ Project - ➚ ]
Work
- FOSS-IIITA [➚] (March 2016 - present) : I am an active member in FOSS-IIITA. As a member, I have organised & participated in various events like IIITA-Hacks[➚], Open-Source workshops, OpenCode[➚] and worked upon many projects [listed in GitHub org] related to our college.
- GeekHaven [➚] (March 2016 - present) : I am an active member of GeekHaven. As a member I have worked on various projects [listed in GitHub org] and currently playing crucial role in organisation of Technical Fest of our college, Aparoksha [➚].
Academics
I am currently sophomore pursuing Bachelors of Technology [B.Tech] course in Information Technology at Indian Institute of Information Technology-Allahabad [IIIT-A ➚]. Software Development courses I have completed or currently undertaking here :
- Theory of Programming
- Computer Organisation & Architecture
- Object Oriented Programming
- Design & Analysis of Algorithms
- Databases Management Systems
| - Theory of Computers and Hardware
- Data Structures
- Operating Systems
- Principles of Programming Languages
|
Why Moodle ?
I am a big time Open-Source enthusiast and use Open-Source softwares wherever and whenever possible because of the awesome community collaborations and love to contribute to Open-Source world.
Moodle being one of the earliest adopters[2002] of Open-Sources and first & best in the field of Education and Learning Management Systems, attracted me to the core of my heart. With its vast user base of 100 Million+, global appeal, rapidly growing Mobile ecosystem, welcoming Developer community I hope I would evolve as a person connecting with people all around globe and my software development skills under collaborative environments would grow multiple folds.
Moodle’s design patterns, coding styles and other best practices taught me a lot since my first involvement here. Moodle, at the core, works for global Education, Training and its effective Management, for which I love to collaborate and contribute and I feel this is the best time and opportunity for it.
References
[1] TestSuites to debug (only 29 in total). Each TestSuite contains 4-6 tests.
- files.spec.js
- notes.spec.js
- calendar.spec.js
- contacts.spec.js
- participants.spec.js
- notification.spec.js
- coursecompletion.spec.js
- teacher_participation.spec.js
- label.spec.js
- login.spec.js
- survey.spec.js
- grades.spec.js
- courses.spec.js
- teacher_new_staff_induction_course.spec.js
| - mod_book.spec.js
- mod_chat.spec.js
- resource.spec.js
- mod_wiki.spec.js
- settings.spec.js
- quiz.spec.js
- mod_forum.spec.js
- mod_assign.spec.js
- mod_choice.spec.js
- mod_folder.spec.js
- mod_glossary.spec.js
- teacher_course.spec.js
- teacher_grades.spec.js
- course_contents.spec.js
- course_filtering.spec.js
|
[2] Features/Modules for which new TestSuites/Tests needs to be added
[ Note 1: This list is not yet completed. This will be further updated after the release of Moodle Mobile v3.3.0 on ~15/5/2017 during community bonding period. ]
[ Note 2: Course specific tests for newly added features, modules, improvements will be done on newly added course “Digital Literacy” which is built exclusively to test latest Moodle Mobile versions ]
- Lesson Module
- FeedBack Module
- DataBase Module
- User Profile Badges
- Message preferences
- Notification preferences
- Message functionality
- Logout functionality
- Privacy Policy Info
- My Files Uploads
- Search Messages & Contacts
| - Context Menu for all Modules
- Signup functionality
- Profile Picture Update
- My Grades functionality
- Glossary improvements
- Forum improvements
- Calendar improvements
- Wiki improvements
- Message & Notification Counters
- Submission improvements
- Various other improvements
|
[3] Unit tests present in the codebase are currently outdated and might be misleading for beginners. ( I myself stumbled upon them for a week ). Later, Mobile Team Lead, Juan Leyva has confirmed that Unit tests won’t be added in MOBILE-1952[➚]. So, existing Unit tests can be safely removed along Karma and other related dependencies.