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

(test) O3-2943: Edit E2E test for the immunization recording workflow #1768

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Vijaykv5
Copy link
Contributor

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

This PR introduces changes that edits E2E test for recording an immunization

Related Issue

O3-2943

Other

@Vijaykv5 Vijaykv5 changed the title (test) O3-2943: Edit e2e test for the immunization recording workflow (test) O3-2943: Edit E2E test for the immunization recording workflow Mar 31, 2024
@Vijaykv5
Copy link
Contributor Author

Vijaykv5 commented Mar 31, 2024

@kdaud This was passing in local instance,but in github cli, the test is failing
Kindly can you review it
Thanks

@kdaud
Copy link
Member

kdaud commented Apr 1, 2024

@Vijaykv5 did you take a look at the logs?

@denniskigen
Copy link
Member

Here's the playwright report:

playwright-report (2).zip

Looks like the test is failing because there are no immunizations to edit. Maybe you need to combine the two specs.

@Vijaykv5
Copy link
Contributor Author

Vijaykv5 commented Apr 5, 2024

@Vijaykv5 did you take a look at the logs?

Yes @kdaud
I'm not able to figure out, the test is failing here:
await page.click('[aria-label="Expand current row"]');

@Vijaykv5
Copy link
Contributor Author

Vijaykv5 commented Apr 5, 2024

but @denniskigen we are separating each functions right?
add, edit and cancel immunization. #comment

@denniskigen
Copy link
Member

I defer to @jayasanka-sack for the ideal approach.

@jayasanka-sack
Copy link
Member

@Vijaykv5

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 beforeAll to avoid this, but then the edit test would depend on the create test, and we want to keep them separate.

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! :)

@Vijaykv5
Copy link
Contributor Author

@Vijaykv5

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 beforeAll to avoid this, but then the edit test would depend on the create test, and we want to keep them separate.

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?

@jayasanka-sack
Copy link
Member

jayasanka-sack commented Apr 24, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants