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-2107: Add patient chart allergies E2E test #1205

Merged
merged 14 commits into from Aug 15, 2023

Conversation

RandilaP
Copy link
Contributor

@RandilaP RandilaP commented Jun 9, 2023

Requirements

  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • 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 includes tests or is validated by existing tests.

Summary

This PR aims to write an E2E test for record allergies in the patient chart repository.

Screenshots

image

Related Issue

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

Other

@RandilaP RandilaP marked this pull request as draft June 9, 2023 16:00
@RandilaP
Copy link
Contributor Author

RandilaP commented Jun 9, 2023

@jayasanka-sack @anjula-sack @Piumal1999 Could you please review this PR?

e2e/specs/record-allergies.spec.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

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

Shall we add the comments as well?

image

@anjula-sack
Copy link
Collaborator

Let's extend the test to test the food and environment allergies as well @RandilaP
image

@anjula-sack
Copy link
Collaborator

Good job! @RandilaP Let's test the notification as well.

image

@RandilaP
Copy link
Contributor Author

@jayasanka-sack @anjula-sack @Piumal1999 Could you please review the changes

@RandilaP RandilaP marked this pull request as ready for review June 11, 2023 03:15
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 @RandilaP for the PR. I've taken the time to review it and have left some comments. Could you please take a moment to review them? Let me know if you require any further clarifications.

e2e/specs/record-allergies.spec.ts Outdated Show resolved Hide resolved
e2e/specs/record-allergies.spec.ts Outdated Show resolved Hide resolved
e2e/specs/record-allergies.spec.ts Outdated Show resolved Hide resolved
e2e/pages/PatientAllergiesPage.ts Outdated Show resolved Hide resolved
e2e/pages/PatientAllergiesPage.ts Outdated Show resolved Hide resolved
e2e/pages/PatientAllergiesPage.ts Outdated Show resolved Hide resolved
e2e/specs/record-allergies.spec.ts Outdated Show resolved Hide resolved
e2e/specs/record-allergies.spec.ts Outdated Show resolved Hide resolved
@jayasanka-sack jayasanka-sack changed the title (test) O3:2107 - Add patient chart allergies E2E test (test) O3-2107: Add patient chart allergies E2E test Jun 11, 2023
.github/workflows/e2e.yml Outdated Show resolved Hide resolved
.github/workflows/e2e.yml Outdated Show resolved Hide resolved
@anjula-sack
Copy link
Collaborator

@RandilaP Can you fix the conflicts?

Copy link
Collaborator

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

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

can you check your screenshot as well @RandilaP,

image

@@ -3,6 +3,7 @@ import { Page } from '@playwright/test';
export class AllergiesPage {
constructor(readonly page: Page) {}

readonly tableRow = () => this.page.locator('tr');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add a space here.

Suggested change
readonly tableRow = () => this.page.locator('tr');
readonly tableRow = () => this.page.locator('tr');

Copy link
Member

Choose a reason for hiding this comment

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

There can be other tables on the page. To be specific, we can use the extension id attribute.
data-extension-id="allergies-details-widget".

Also, instead of locating the row, it would be better to locate only the table here. Check my other comment on the spec. Using a variable name something like allergyTable would also work.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder why this doesn't fail because the heading row of the table itself a tr

@RandilaP
Copy link
Contributor Author

@anjula-sack @Piumal1999 @jayasanka-sack Could you please review this

@jayasanka-sack
Copy link
Member

@anjula-sack @Piumal1999 @jayasanka-sack Could you please review this

Hey, @RandilaP! Pro tip: It might be a cool idea to resolve any ongoing conversations before throwing in another review request. 😁 Happy resolving and reviewing!

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.

Keep up the great work! Cheers! 🎉

@@ -3,6 +3,7 @@ import { Page } from '@playwright/test';
export class AllergiesPage {
constructor(readonly page: Page) {}

readonly tableRow = () => this.page.locator('tr');
Copy link
Member

Choose a reason for hiding this comment

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

There can be other tables on the page. To be specific, we can use the extension id attribute.
data-extension-id="allergies-details-widget".

Also, instead of locating the row, it would be better to locate only the table here. Check my other comment on the spec. Using a variable name something like allergyTable would also work.

@@ -3,6 +3,7 @@ import { Page } from '@playwright/test';
export class AllergiesPage {
constructor(readonly page: Page) {}

readonly tableRow = () => this.page.locator('tr');
Copy link
Member

Choose a reason for hiding this comment

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

I wonder why this doesn't fail because the heading row of the table itself a tr

e2e/specs/record-food-allergy.spec.ts Outdated Show resolved Hide resolved
e2e/specs/record-food-allergy.spec.ts Outdated Show resolved Hide resolved
e2e/specs/record-food-allergy.spec.ts Outdated Show resolved Hide resolved
@RandilaP RandilaP marked this pull request as draft July 31, 2023 03:57
@anjula-sack
Copy link
Collaborator

@RandilaP can you fix the conflicts here?

.github/workflows/e2e.yml Outdated Show resolved Hide resolved
.github/workflows/e2e.yml Outdated Show resolved Hide resolved
e2e/pages/allergies-page.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

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

Good job! @RandilaP

@anjula-sack anjula-sack dismissed jayasanka-sack’s stale review August 15, 2023 06:45

Requested change is done

@anjula-sack anjula-sack merged commit 06696d7 into openmrs:main Aug 15, 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
4 participants