Using REST rather than DB calls in UI Tests/Framework

Hi @raff and @tmueller,

I was skimming a bunch of github emails, and I noticed something about “checkIfPatientExists” added to UI tests. I didn’t look at the implementation of this, but let me mention something that @leebreisacher and I talked about long ago, but maybe we didn’t share:

In an ideal world, running the UI tests should be run 100% by having HTTP access on a single port, and not require any direct database access. (This makes the tests much easier to run on different environments.) So, we should try to setup and tear down test data, and check for the existence of things, via REST.

It wasn’t possible to do some things via REST at the time, and we never had time to prioritize fixing that. But, since you’re now doing more with these, please keep that idea in mind, and let’s try to move in that direction.

1 Like

Good point.

Hi @darius, The one operation in UI tests that so far I couldn’t perform using REST was deleting a patient, and I find it important to be possible to do this way, as it needs to be done in most test using patients. Will something be implemented to enable this?

What is the particular issue? Is it that you still cannot get a uuid of a patient after registration (it redirects using patientId) or something else?

No, the problem with getting patient uuid is solved and deleting patient functions are working. The only thing I’m concerned about is that they still use DB calls and I can see no way to convert them to use REST.

Can you point me to the piece of code that uses DB calls, but should not?

deleting patient functions I am using (deletePatient and deletePatientUuid) are here: