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

Add Cypress test to patient file upload #7197

Closed
wants to merge 33 commits into from

Conversation

AshrafMd-1
Copy link
Contributor

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

Copy link

vercel bot commented Feb 8, 2024

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 Mar 12, 2024 4:37pm

Copy link

netlify bot commented Feb 8, 2024

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit f811e96
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/65fe58b23446850008d59cd7
😎 Deploy Preview https://deploy-preview-7197--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.

@AshrafMd-1
Copy link
Contributor Author

AshrafMd-1 commented Feb 8, 2024

@nihal467 for the following

[ ] Verify the uploaded file can only be modified by the author, district admin, and above users.
[ ] Verify file download is possible for all users.

Do I need to sign to each kind of user and check or is there a different way?

cc: @rithviknishad

@nihal467
Copy link
Member

nihal467 commented Feb 11, 2024

@AshrafMd-1

way of approach should be like , use two nurse type and one district admin

Test - 1 Part-1 : Verify the uploaded file can only be modified by the author, district admin, and above users.

  • First, upload a file to a patient file using the nurse user ID-1, and edit the file successfully.
  • Now, log out as nurse user ID-1 and log in as nurse user ID-2. Then try to edit the same file. Expected behavior: "Nurse user ID-2 shouldn't be able to edit the file uploaded by nurse user ID-1." Verify this behavior.
  • Now, log out as nurse user ID-2 and log in as a district admin. Edit the file uploaded by nurse user ID-1. Expected behavior: "The admin should be able to edit the file uploaded by nurse user ID-1."

Test - 1 Part-2 : Verify file download is possible for all users.

  • Verify that the download functionality is working for nurse user ID's and the district admin, along with the part-1 test.

@AshrafMd-1 Answer to the question : Only check for district admin and nurse userID

@AshrafMd-1
Copy link
Contributor Author

AshrafMd-1 commented Feb 11, 2024

@nihal467 done I understood

Also other small doubt what patient should I use

Like I created a patient but it was not coming on cypress

@nihal467
Copy link
Member

nihal467 commented Feb 11, 2024

@AshrafMd-1 don't create a new patient, just use a patient in the existing dummy data

@AshrafMd-1 AshrafMd-1 marked this pull request as ready for review February 18, 2024 09:02
@AshrafMd-1 AshrafMd-1 requested a review from a team as a code owner February 18, 2024 09:02
@AshrafMd-1
Copy link
Contributor Author

@nihal467 can you check this once

cc: @rithviknishad

@nihal467
Copy link
Member

@AshrafMd-1 your test is failing

Copy link

vercel bot commented Mar 18, 2024

@AshrafMd-1 is attempting to deploy a commit to the Open Healthcare Network Team on Vercel.

A member of the Team first needs to authorize it.

@AshrafMd-1
Copy link
Contributor Author

@nihal467 once this PR gets merged in care related to nurse logins, then I will rerun the tests

ohcnetwork/care#1985

@nihal467
Copy link
Member

@AshrafMd-1 the test is again failing, the backend is merged

@AshrafMd-1
Copy link
Contributor Author

AshrafMd-1 commented Mar 19, 2024

@nihal467 I am not able to understand the error
The tests works locally but when I upload here no patients are found

  • I did check the district ernakulam
  • The home facility dummy facility 40

But then the screenshots says no patients are found

So can you give me some guidance on what to do?

@nihal467
Copy link
Member

image

@AshrafMd-1 check the login id user access, whether it is having the particular facility access

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Mar 20, 2024
@AshrafMd-1
Copy link
Contributor Author

@nihal467

Here is the nurse1 profile
image

Here is its data

image

But its showing no facility or patients
image

@AshrafMd-1
Copy link
Contributor Author

{"model": "users.user",
        "pk": 23,
        "fields": {
            "password": "argon2$argon2id$v=19$m=102400,t=2,p=8$WDE0YXVzR1dIV09zNWJZalF4QzdXSw$ZTpeDj5sbB3TKfu0DEJ5EkQnL3EmM2vGgvdx+Qt2sAw",
            "last_login": "2024-03-18 17:04:08.753272+00",
            "is_superuser": false,
            "first_name": "Dummy",
            "last_name": "Nurse",
            "email": "[email protected]",
            "is_staff": false,
            "is_active": true,
            "date_joined": "2024-03-08 06:31:23.199154+00",
            "username": "dummynurse1",
            "user_type": 14,
            "created_by": 1,
            "ward": null,
            "local_body": null,
            "district": 7,
            "state": 1,
            "phone_number": "+918878825662",
            "alt_phone_number": "+918878825662",
            "gender": 2,
            "age": 21,
            "home_facility": 1,
            "verified": true,
            "deleted": false,
            "pf_endpoint": null,
            "pf_p256dh": null,
            "pf_auth": null,
            "asset": null,
            "groups": [],
            "user_permissions": []
            }

Also here is the data for nurse 1 is there any wrong?

cc: @rithviknishad

@AshrafMd-1
Copy link
Contributor Author

@nihal467 once this PR ohcnetwork/care#2012 is merged i will test it again

Also I will create a new PR as there are test commits here

Copy link

👋 Hi, @AshrafMd-1,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Mar 28, 2024
@AshrafMd-1
Copy link
Contributor Author

Add this PR has many test commits I will close and open a new PR

@AshrafMd-1 AshrafMd-1 closed this Mar 31, 2024
@AshrafMd-1 AshrafMd-1 deleted the Fix-#7086 branch March 31, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required Deploy-Failed Deplyment is not showing preview merge conflict pull requests with merge conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Cypress Test for Patient file upload
3 participants