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

(fix) O3-2284: Fix failing patient registration test #763

Merged
merged 12 commits into from
Aug 7, 2023

Conversation

Piumal1999
Copy link
Collaborator

Requirements

Summary

Fixed the failing patient registration e2e test:

  1. Corrected the patient attribute
  2. Implemented a function that waits until the form is loaded, before filling in the data.

Screenshots

None.

Related Issue

https://issues.openmrs.org/browse/O3-2284

Other

None.

example.env Outdated
@@ -1,5 +1,5 @@
# This is an example environment file for configuring dynamic values.
E2E_BASE_URL=http://localhost:8080/openmrs
E2E_BASE_URL=https://dev3.openmrs.org/openmrs
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer if the example setup didn't point at dev3. We need to limit the usage of dev3 for automated testing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I just wanted to verify that it works with dev3. The patient registration didn't pass when running locally. It fails to load the patient-chart view after creating a patient. I'm still looking into fixing that bug.

image

I'm going to revert the line after it is resolved.

@@ -77,7 +77,7 @@ export const generateRandomPatient = async (api: APIRequestContext): Promise<Pat
],
attributes: [],
birthdate: '2020-2-1',
birthdateEstimated: true,
birthdateEstimated: false,
Copy link
Member

Choose a reason for hiding this comment

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

Is this change necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. If we use birthdayEstimated as true, it will take the patient as a "patient with an unknown birthdate". So when we go to the edit patient page, it will automatically use the "Birthdate unknown" option.

image

(That change was added with 7dbf922. And the tests were failing after that)

Copy link
Member

Choose a reason for hiding this comment

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

PS While it may not matter much, it's less ambiguous (and more likely to work everywhere) if we stick to ISO 8601 for dates, i.e., 2020-02-01.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's right. I changed the date format.

e2e/commands/patient-operations.ts Outdated Show resolved Hide resolved
Piumal1999 added a commit to Piumal1999/openmrs-esm-patient-management that referenced this pull request Aug 3, 2023
jayasanka-sack pushed a commit that referenced this pull request Aug 7, 2023
* Dynamic frontend Docker image for e2e test

* Change directory

* Fix tests

* Update e2e/support/github/run-e2e-docker-env.sh

Co-authored-by: Ian <[email protected]>

* Update e2e/support/github/Dockerfile

Co-authored-by: Ian <[email protected]>

* Fix the port numbers

* Remove unwanted MFs

* Remove unwanted MFs

* Remove unwanted MFs

* Remove unwanted MFs

* Remove unwanted MFs

* Test only with login and home apps

* Test with navigation, chart and home apps

* (Breaking) Revert the changes related to #763

---------

Co-authored-by: Ian <[email protected]>
Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

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

@Piumal1999 I merged latest changes to your PR and reran tests. All the test cases are passing now.

@Piumal1999 Piumal1999 marked this pull request as ready for review August 7, 2023 16:10
Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

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

Thanks @Piumal1999 !

@jayasanka-sack jayasanka-sack merged commit 4c9aca4 into openmrs:main Aug 7, 2023
7 checks passed
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.

4 participants