Testing the registration flow of OpenMRS 3.x

Jayasanka Weerasinghe
2 min readJul 6, 2021

This is my 4th week of Google summer of code. The main focus of this week was to complete and end to end test for the patient registration flow. There are two scenarios for the patient registration flow. One is searching for a patient, while the other is registering one.

This is the feature file of the patient search:

It searches for both existing and non-existing patients, as specified in the feature file. If the page displays the expected results, the test should pass. However, because we are using a publicly deployed server, these tests may fail because someone on the server may inadvertently change the data. For instance, if someone creates a patient named “Fred Wells”, then the second example will fail. Therefore, I’m hoping that having a deployment with a known state will aid in obtaining deterministic results.

This is the feature file of the patient registration:

I have implemented the relevant steps using cypress. Despite the fact that the details are correct, the server throws an error. It appears to be a problem with the backend. I need to look into it further, and I plan to address it on the next QA team call.

Aside from that, I implemented some helper functions for logging in to the dashboard by following the steps and logging in using an API call.

I believe that creating a separate Docker container that fires up each time we run the tests would be beneficial in obtaining deterministic results. This will need to be discussed during the upcoming calls.

As always, thanks, Google and OpenMRS for this wonderful opportunity!

Let’s get connected

Follow/connect with me anytime.

Github: https://github.com/jayasanka-sack
Linkedin: https://www.linkedin.com/in/jayasanka-sack
Facebook: https://www.facebook.com/jayasanka.sack

--

--

Jayasanka Weerasinghe

A professional key presser who turns characters into interesting web things 🙂