-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(test) Use UI flow instead of direct API calls to test removing a patient from a list #1487
Conversation
281a371
to
2f1b186
Compare
Size Change: 0 B Total Size: 6.27 MB ℹ️ View Unchanged
|
2f1b186
to
7762148
Compare
Another day, another "why does this e2e test pass locally and fail here????" |
The problem here is that the patient lists header count is supposed to update and show |
To add more context, this PR tries to update the e2e test that deletes a patient from a list by using the user interface. Up until now, this test did this by having a function to directly call the API. In these two PRs - openmrs/openmrs-esm-core#1280, openmrs/openmrs-esm-core#1290, this test started failing because the API call failed for some reason. Which is why I tried to resort to using the UI, because we can and we should anyway. |
5df3522
to
3a67a53
Compare
@jayasanka-sack would appreciate your input on this |
The issue could be related to time zones (client vs backend); @NethmiRodrigo try voiding the membership explicitly here: return postData(`${cohortUrl}/cohortmember/${cohortMembershipUuid}`, {
endDate: new Date(),
voided: true
}); |
@samuelmale sorry I don't understand. Since the delete button calls this function on click, doesn't this already happen? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is impossible to test after we’ve removed the Patient list related frontend modules from the distro, but I’m confident these changes put us in a better position for when we restore that functionality in the future.
Oh right, yeah I completely forgot that we removed that. Do you think it's better to just close this PR @denniskigen |
I think we can merge it in and sort things out when we restore the two modules in the future. |
Previously, the patient list e2e test was using direct API calls to test patient removal. This change: - Breaks down the single test step into multiple, more specific steps - Tests the actual user flow by interacting with the UI (clicking remove button, confirming in modal) - Adds verification of success message and patient count updates - Adds appropriate timeout for patient count update This makes the test more valuable by verifying the complete user experience rather than just the API integration.
bde48d3
to
ea8cd8f
Compare
Oh wait, both frontend modules still exist in the e2e test docker environment. Maybe we should explicitly omit them from inclusion in |
Requirements
Summary
The e2e test for managing a patient list heavily relies on directly making API calls rather than interacting with the user interface, which defeats the purpose of it existing. This updates just the delete patient to hopefully get more info as to why it fails in this PR.
Screenshots
Related Issue
Other