-
Notifications
You must be signed in to change notification settings - Fork 209
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) O3-2943: Edit E2E test for the immunization recording workflow #1768
base: main
Are you sure you want to change the base?
Conversation
@kdaud This was passing in local instance,but in github cli, the test is failing |
@Vijaykv5 did you take a look at the logs? |
Here's the playwright report: Looks like the test is failing because there are no immunizations to edit. Maybe you need to combine the two specs. |
but @denniskigen we are separating each functions right? |
I defer to @jayasanka-sack for the ideal approach. |
Check line 10. When the edit test runs, it fails because it's using a brand-new patient with no existing data. We could switch to using A good fix would be to create an immunization record at the start of the edit test using the REST API. That should provide the necessary data for the test to work properly. Lemme know if you have any questions! :) |
@jayasanka-sack So do I need to call this API inside commands or I may need to create a separate file for creating immunization record using the REST API? |
@Vijaykv5 Write a command and call it within the edit test. Yes, you may need to create a new file under the commands directory. |
@jayasanka-sack could you please help Vijay get this over the line? |
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.
@Vijaykv5 Follow these steps:
-
In
e2e/fixtures/api.ts
, update the base url of the API fixture to${process.env.E2E_BASE_URL}/ws
. So that we can invoke fhir endpoints -
Update existing API calls to use
/rest/
prefix. ex:const patientRes = await api.post('/rest/patient', {
-
Create a new function under
patient-operations.ts
file to create an immunization.
You should send a post request to the following endpoint with the given payload (feel free to edit).
/fhir2/R4/Immunization?_summary=data
{ "resourceType": "Immunization", "status": "completed", "vaccineCode": { "coding": [ { "code": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "display": "Polio vaccination, oral" } ] }, "patient": { "type": "Patient", "reference": "Patient/703840a5-7339-4dc2-8993-f7cc7b96fc94" }, "encounter": { "type": "Encounter", "reference": "Encounter/fca94b00-8b1f-4468-b006-68e77f438978" }, "occurrenceDateTime": "2024-06-10T13:50:00.000Z", "expirationDate": "2052-06-29T18:30:00.000Z", "location": { "type": "Location", "reference": "Location/44c3efb0-2583-4c80-a79e-1f756a03c0a1" }, "performer": [ { "actor": { "type": "Practitioner", "reference": "Practitioner/f39e57d8-1185-4199-8567-6f1eeb160f05" } } ], "manufacturer": { "display": " Sanofi Pasteur SA" }, "lotNumber": "POLIO-001", "protocolApplied": [ { "doseNumberPositiveInt": 1, "series": null } ] }
-
Create a new spec file for the edit immunization
-
Call the created function from the
beforeEach
hook of the test.
@jayasanka-sack The PR now works fine locally with the help of |
Requirements
Summary
This PR introduces changes that edits E2E test for recording an immunization
Related Issue
O3-2943
Other