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 cypress test for asset creation #5632

Merged
merged 22 commits into from
Jun 13, 2023

Conversation

ShivamJhaa
Copy link
Contributor

@ShivamJhaa ShivamJhaa commented Jun 8, 2023

WHAT

Added cypress test for asset creation

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 dec2ae0

  • Add data-testid attributes to various input fields and buttons in AssetCreate.tsx and AssetsList.tsx to enable locating them in test cases (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add a test case for creating an asset in assets.cy.ts that fills in the required fields and verifies the success notification (link)
  • Import the uuid module in assets.cy.ts and vite.config.ts to generate unique identifiers for the asset QR codes in the test cases (link, link)
  • Add a comment to disable the eslint rule for using require in vite.config.ts (link)
  • Remove an empty line in patient_crud.cy.ts (link)

@ShivamJhaa ShivamJhaa requested a review from a team June 8, 2023 19:30
@ShivamJhaa ShivamJhaa requested a review from a team as a code owner June 8, 2023 19:30
@ShivamJhaa ShivamJhaa requested a review from gigincg June 8, 2023 19:30
@vercel
Copy link

vercel bot commented Jun 8, 2023

@ShivamJhaa is attempting to deploy a commit to the Coronasafe Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link

netlify bot commented Jun 8, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit fdb6fd9
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6488103f45c41c0008431abb
😎 Deploy Preview https://deploy-preview-5632--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 settings.

@ShivamJhaa
Copy link
Contributor Author

@nihal467 @khavinshankar Please review the PR.
Thanks!

@vercel
Copy link

vercel bot commented Jun 10, 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 Jun 13, 2023 6:45am

@nihal467
Copy link
Member

@ShivamJhaa The cypress test run by the GitHub action uses a dedicated backend, with dummy data loaded to it, it is only having facilities named "Dummy Facility 1" and "Dummy Shifting Center". Currently, I have updated it, but next time make sure you use those facilities only :)

@nihal467
Copy link
Member

@ShivamJhaa there is a failure in cypress, check it

@ShivamJhaa
Copy link
Contributor Author

@ShivamJhaa The cypress test run by the GitHub action uses a dedicated backend, with dummy data loaded to it, it is only having facilities named "Dummy Facility 1" and "Dummy Shifting Center". Currently, I have updated it, but next time make sure you use those facilities only :)

Strangely, the test was passing on Cl even when I was using the local backend data.
https://github.com/coronasafe/care_fe/actions/runs/5215017623/jobs/9412022568#step:10:66

@ShivamJhaa
Copy link
Contributor Author

@nihal467 Please review it, the tests are passing now.
Thanks!

vite.config.ts Outdated Show resolved Hide resolved
vite.config.ts Outdated Show resolved Hide resolved
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.

@ShivamJhaa before pushing the PR, make sure that you revert the changes you are making in vite.config.ts to run your own backend

@ShivamJhaa
Copy link
Contributor Author

@ShivamJhaa before pushing the PR, make sure that you revert the changes you are making in vite.config.ts to run your own backend

Sure, will keep this in mind, thanks!

@nihal467
Copy link
Member

LGTM

@khavinshankar
Copy link
Member

@nihal467 can u review and approve this pr

@khavinshankar khavinshankar merged commit 5ee4f15 into coronasafe:develop Jun 13, 2023
27 of 28 checks passed
@ShivamJhaa ShivamJhaa deleted the asset_creation branch June 13, 2023 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress tests for few functionalities
3 participants