Project Title: E2E Automated Tests for the OpenMRS 3.0 RefApp
Primary mentor: @k.joseph
Backup mentor: @bistenes
Student: Jayasanka Weerasinghe
Project Link: GSoC 2021: E2E Automated Tests for the OpenMRS 3.0 RefApp
Overview
Asa result of the Microfrontend Team’s tireless efforts, OpenMRS will soon have its new edition “OpenMRS 3.0”. Most of the MFE applications have unit tests and integration tests. Those tests will take a small part of the application and assess that part in isolation. However, even the small parts of the application work fine, It does not guarantee that they will work together as a group. This is where the E2E tests (End-to-End Tests) additional test layer comes into play. The goal of the project is to set up E2E tests that automate realistic User Workflows to ensure that they work as they should.
Objectives
- Evidence that the squad/dev team regularly references the automated tests during PRs (i.e. they use them to catch if their PR will break something, and so they fix their code quickly rather than waiting for manual tests to catch something weeks or even months later)
- Evidence that the squad/dev team regularly references the tests during releases every 1-4 weeks (e.g. “ok the tests are all green, we can release without doing painful manual QA) (though for 2. to be possible we need an actual production environment setup; discussion about that happening here: Creating a build pipeline for OpenMRS 3.0
- Business-type stakeholders (e.g. Grace, JJ, Dimitri, Eric) feel confident in releasing / they trust the tests
- The qaframework README should have
- Badges showing test statuses
- Clear instructions for local dev setup
- Explanation of the testing architecture
Demo:
Contributions
Repository:
Pull requests:
Issues:
Weekly Blog Posts
Resources
- OpenMRS contrib-qaframework repo
- QA Dashboard: Project Status
- Demo video
- Developer Documentation
- Detailed background about OpenMRS 3.0
- Cypress demo examples from other projects in the OMRS community
- “Testing Strategies” section of Cypress Docs on network requests
Future Work
- Create a GitHub workflow to run RefApp 3.x E2E rests in a dockerized environment We need to make the tests repeatable despite data mutations. Ideally, the tests would run against a dockerized server and dockerized database where the data is in the image/container itself, such that any changes are lost each time a new container is spun up. Read More.
- Implement the rest of the workflows listed here.
- Enhance the developer experience in creating new workflows. The current setup takes a lot of time to run tests because cypress clears the cache and it needs to download the resources (~30MB) every time it runs a test. The loading time can be decreased by either finding a way to cache the files or running the test instance locally.
Final Words
This is my second time being chosen for Google Summer of Code. While working on my project, I was able to unofficially mentor two other GSoC projects at OpenMRS. Working at OpenMRS was always been a pleasure for me. Not only have my programming skills improved but so have my soft skills, such as communication and presentation.
I’d like to thank my primary mentor, Kawesi Joseph, who passed away from us during the project. He was always a pleasant person and an excellent mentor to me. I am also grateful to Brandon Istenes, my secondary mentor, who assisted me greatly in completing this project successfully. I am also grateful to Grace Potma, Ian Bacher, Daud Kakumirizi, and Sharif Magembe for their assistance throughout the project. I’d also like to thank Herbert Yiga for always encouraging us to post our updates on time. A special thanks to Akshika Wijesundara for introducing me to OpenMRS. Finally, I’d like to express my gratitude to Google and OpenMRS for providing me with this fantastic opportunity!