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

Added test for resource, facility and migrated them to POM approach #6106

Merged
merged 22 commits into from
Sep 7, 2023

Conversation

ShivamJhaa
Copy link
Contributor

@ShivamJhaa ShivamJhaa commented Aug 19, 2023

WHAT

🤖 Generated by Copilot at 5d322f7

This pull request improves the cypress test cases for the resource page by using page object classes and custom commands. It also adds new test functionality for the status and comment features of the resource page. To support the test cases, it adds data-testid attributes to some elements in the resource page components.

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at 5d322f7

  • Refactor and add test cases for the resource page using page object pattern (link, link, link)
  • Add data-testid attributes to the resource details buttons and the update status button to facilitate cypress testing (link, link, link)
  • Import local-cypress module for custom commands and aliases in assets_manage.cy.ts (link)

@ShivamJhaa ShivamJhaa requested a review from a team August 19, 2023 04:37
@ShivamJhaa ShivamJhaa requested a review from a team as a code owner August 19, 2023 04:37
@ShivamJhaa ShivamJhaa requested a review from gigincg August 19, 2023 04:37
@vercel
Copy link

vercel bot commented Aug 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 10:12am

@ShivamJhaa ShivamJhaa marked this pull request as draft August 19, 2023 04:37
@netlify
Copy link

netlify bot commented Aug 19, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 8885d01
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/64f9a1ce53d09a00081a0446
😎 Deploy Preview https://deploy-preview-6106--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ShivamJhaa ShivamJhaa marked this pull request as ready for review August 19, 2023 04:40
@github-actions
Copy link

github-actions bot commented Sep 2, 2023

Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 2, 2023
@ShivamJhaa ShivamJhaa changed the title Added test for resource and migrated it to POM Added test for resource, facility and migrated them to POM approach Sep 5, 2023
Copy link
Member

@nihal467 nihal467 left a comment

Choose a reason for hiding this comment

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

Add API Verification to confirm successful form submission

"Test description"
);
facilityPage.clickSubmitRequestButton();
facilityPage.verifySuccessNotification(
Copy link
Member

Choose a reason for hiding this comment

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

add api verification

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

cypress/e2e/facility_spec/facility.cy.ts Show resolved Hide resolved
facilityPage.clickManageFacilityDropdown();
facilityPage.clickDeleteFacilityOption();
facilityPage.confirmDeleteFacility();
});
Copy link
Member

Choose a reason for hiding this comment

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

for deleting a facility, district admin have no access, so verify the error message and the API response

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

facilityPage.clickManageInventory();
facilityPage.fillInventoryDetails("Liquid Oxygen", "Add Stock", "120");
facilityPage.clickAddInventory();
facilityPage.verifySuccessNotification("Inventory created successfully");
Copy link
Member

Choose a reason for hiding this comment

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

verify using api

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

resourcePage.clickUpdateStatus();
resourcePage.updateStatus("APPROVED");
resourcePage.clickSubmitButton();
resourcePage.verifySuccessNotification(
Copy link
Member

Choose a reason for hiding this comment

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

verify the submission using API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

resourcePage.openAlreadyCreatedResource();
resourcePage.addCommentForResource("Test comment");
resourcePage.clickPostCommentButton();
resourcePage.verifySuccessNotification("Comment added successfully");
Copy link
Member

Choose a reason for hiding this comment

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

verify using api

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

rithviknishad and others added 4 commits September 6, 2023 23:10
* adds field principle diagnosis

* show in consultation details

* fix typo

* fix cypress

* try adding wait

* fix tests
* Added padding to count block on patients page

* fixed date format in asset manage page

* Merged configure facility and configure health facility in one page

* removed commented code

* changed weekly to average weekly for working hours
@nihal467
Copy link
Member

nihal467 commented Sep 6, 2023

LGTM

@khavinshankar khavinshankar merged commit e1f00fa into ohcnetwork:develop Sep 7, 2023
22 of 23 checks passed
@ShivamJhaa ShivamJhaa deleted the resource_test branch September 7, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add test for resources.cy.ts
6 participants