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-2428: E2E test for appointment scheduling #1062

Merged
merged 7 commits into from May 8, 2024

Conversation

Vijaykv5
Copy link
Contributor

@Vijaykv5 Vijaykv5 commented Mar 25, 2024

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 covers E2E test to test the appointment workflow.

The test involves adding an appointment for a patient, edit the added appointment, and cancel it.

Screenshots

appointments-test.mov

Related Issue

O3-2428
O3-2891

@denniskigen
Copy link
Member

You need to switch from the Upcoming tab to the Today tab before cancelling the appointment. As you've edited the date to today, your scheduled appointment moved to the Today tab, @Vijaykv5.

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.

Hey @Vijaykv5 ,

Could you please address this as well? openmrs/openmrs-esm-patient-chart#1664 (comment)

@kdaud
Copy link
Member

kdaud commented Mar 27, 2024

@Vijaykv5 could you address the pending reviews and we get this PR merged?

@Vijaykv5
Copy link
Contributor Author

@Vijaykv5 could you address the pending reviews and we get this PR merged?

Yes @kdaud I'll do it today

@Vijaykv5
Copy link
Contributor Author

Vijaykv5 commented Mar 27, 2024

@jayasanka-sack had a discussion with @denniskigen on this PR during coffee break and why it's failing.
He told that the possible reasons may be with the timezone as we checked it locally and it's was working fine without any errors.

@Vijaykv5
Copy link
Contributor Author

Vijaykv5 commented Mar 27, 2024

Hey @Vijaykv5 ,

Could you please address this as well? openmrs/openmrs-esm-patient-chart#1664 (comment)

So do we need to split up the this into three tests? Add, Edit and Cancel appointments?

@kdaud
Copy link
Member

kdaud commented Mar 27, 2024

why it's failing. the possible reasons may be with the timezone as we checked it locally and it's was working fine without any errors.

Let me skim through the code....

await test.step('And I change the date to Today', async () => {
const today = new Date();
today.setDate(today.getDate());
await page.fill('input[placeholder="dd/mm/yyyy"]', today.toLocaleDateString('en-GB'));
Copy link
Member

@kdaud kdaud Mar 27, 2024

Choose a reason for hiding this comment

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

Just as @denniskigen mentioned, this action changes the appointment date from what was set before (Tomorrow) to Today and thus requires in the preceding actions to switch the test to click on Today's tab before clicking the options menu...

e2e/specs/appointments.spec.ts Show resolved Hide resolved
@Vijaykv5 Vijaykv5 requested a review from kdaud March 29, 2024 06:49
@kdaud
Copy link
Member

kdaud commented Mar 29, 2024

@Vijaykv5 please fix the failing build and also address the pending review at #1062 (review)

@Vijaykv5
Copy link
Contributor Author

Vijaykv5 commented Mar 29, 2024

@kdaud could you help me with solving this error in E2E tests?
Error E2E test

@kdaud
Copy link
Member

kdaud commented Mar 29, 2024

@kdaud could you help me with solving this error in E2E tests?

Are you able to reproduce the issue?

@Vijaykv5
Copy link
Contributor Author

@kdaud could you help me with solving this error in E2E tests?

Are you able to reproduce the issue?

Actually nope! it's just the error in github cli

But now when saperating each actions, how can we get same patient uuid, so that the add,edit and delete can happen with a single patient.

@kdaud
Copy link
Member

kdaud commented Mar 29, 2024

Actually nope! it's just the error in github cli

Double check with the element locator being cited in the logs.

@Vijaykv5 regarding this review did you reach out to Jayasanka as mentioned on one of the coffee break?

@Vijaykv5
Copy link
Contributor Author

Actually nope! it's just the error in github cli

Double check with the element locator being cited in the logs.

@Vijaykv5 regarding this review did you reach out to Jayasanka as mentioned on one of the coffee break?

cool I'll just checkout with him

@Vijaykv5
Copy link
Contributor Author

While creating appointment locally as well as in dev3, there is no data under select option
This is the reason for this PR failure.

Screen.Recording.2024-03-31.at.10.51.37.PM.mov

cc: @kdaud @jayasanka-sack

@kdaud
Copy link
Member

kdaud commented Apr 15, 2024

@Vijaykv5 are you able to reproduce the issue on a local instance?

@Vijaykv5
Copy link
Contributor Author

@Vijaykv5 are you able to reproduce the issue on a local instance?

Yes @kdaud the same I mentioned above

@kdaud
Copy link
Member

kdaud commented Apr 16, 2024

I'll take a look when the dev3 is back.

@kdaud
Copy link
Member

kdaud commented Apr 16, 2024

@Vijaykv5 in reference to this comment, refer to the desired approach: https://openmrs.atlassian.net/browse/O3-3064?focusedCommentId=140494

@denniskigen
Copy link
Member

Any updates on this, @Vijaykv5?

@Vijaykv5
Copy link
Contributor Author

Vijaykv5 commented May 8, 2024

@denniskigen So I've made all add, edit and delete into single test for now.
In future, we'll try to separate them for each actions.

May you can review this.

Thanks!

@denniskigen denniskigen force-pushed the test/O3-2428 branch 2 times, most recently from fc0c9e0 to 5f04f04 Compare May 8, 2024 20:11
Copy link
Member

@denniskigen denniskigen left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, @Vijaykv5! I've commented out one test case related to locations failing to load in the test environment. It'd be great if this could be sorted out when working on separating out the test cases into independent steps.

@denniskigen denniskigen merged commit 65cb1bd into openmrs:main May 8, 2024
6 checks passed
@Vijaykv5 Vijaykv5 deleted the test/O3-2428 branch May 8, 2024 23:51
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