Skip to content
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

OZ-554: E2E tests for handling voided entities when streaming with Analytics #89

Merged
merged 6 commits into from
May 27, 2024

Conversation

kdaud
Copy link
Contributor

@kdaud kdaud commented May 17, 2024

Ticket OZ-554

This PR adds the following E2E tests handling voidable entities when streaming with Analytics.

  • Voiding an OpenMRS patient updates the patient in Superset patients table.
  • Voiding an OpenMRS condition updates the condition in Superset conditions table.
  • Voiding an OpenMRS encounter updates the encounter in Superset encounters table.
  • Cancelling an OpenMRS appointment updates the appointment in Superset appointments table.

@kdaud kdaud force-pushed the OZ-554 branch 5 times, most recently from dd5bc84 to f4dd61d Compare May 20, 2024 08:19
await expect(patientVoidedState).toContainText('false');

// replay
await openmrs.deletePatient();
Copy link
Contributor Author

@kdaud kdaud May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular test case invokes openmrs.deletePatient() during the replay thus voiding the patient. This implies that the test will fail if the method is called again in the cleanup function (afterEach()) so the suggested approach is to let each test case invoke the function that voids the patient.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If deletions are actually voids in OpenMRS, I'd rather change openmrs.deletePatient() to openmrs.voidPatient().

@kdaud kdaud requested a review from Ruhanga May 20, 2024 08:59
Copy link
Contributor

@Ruhanga Ruhanga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM. Save a little comment below.

await expect(patientVoidedState).toContainText('false');

// replay
await openmrs.deletePatient();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If deletions are actually voids in OpenMRS, I'd rather change openmrs.deletePatient() to openmrs.voidPatient().

Copy link
Contributor

@Ruhanga Ruhanga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to change too?

e2e/utils/functions/openmrs.ts Outdated Show resolved Hide resolved
@kdaud kdaud requested a review from Ruhanga May 20, 2024 10:35
Copy link
Contributor

@Ruhanga Ruhanga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kdaud kdaud merged commit 7cd3d13 into main May 27, 2024
@kdaud kdaud deleted the OZ-554 branch May 27, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants