-
Notifications
You must be signed in to change notification settings - Fork 543
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
Fixed the user fixtures in cypress test #10442
Conversation
WalkthroughThis pull request updates the authentication process in the Cypress test suite for patient management. The login credentials within the test are changed from using the "doctor" role to "devdoctor". Correspondingly, a new user entry for "devdoctor" is added in the fixtures file with specific credentials. The changes are confined to test automation files and do not affect the control flow or the public API. Changes
Sequence Diagram(s)sequenceDiagram
participant TS as Test Suite
participant API as Authentication API
participant PM as Patient Management Module
TS->>API: cy.loginByApi("devdoctor")
API-->>TS: Auth token
TS->>PM: Fetch patient details
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying care-fe with
|
Latest commit: |
3ed2e14
|
Status: | ✅ Deploy successful! |
Preview URL: | https://78680770.care-fe.pages.dev |
Branch Preview URL: | https://cypress-fixtures.care-fe.pages.dev |
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
cypress/e2e/patient_spec/patient_details.cy.ts (1)
10-13
: Consider moving login tobefore
hook.Based on previous learnings from PR #10287, when using
cy.session
, a singleloginByApi
call in thebefore
hook is sufficient as Cypress automatically handles session creation and restoration. Additional login calls inbeforeEach
are redundant.describe("Patient Management", () => { + before(() => { + cy.loginByApi("devdoctor"); + }); + beforeEach(() => { - cy.loginByApi("devdoctor"); cy.visit("/"); });cypress/fixtures/users.json (1)
22-24
: Consider following consistent username format.While the new user entry is good, consider following the hyphenated format used by other test users (e.g., "nihal-nurse", "arjun-doctor") for consistency.
"devdoctor": { - "username": "developdoctor", + "username": "dev-doctor", "password": "Test@123"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
cypress/e2e/patient_spec/patient_details.cy.ts
(1 hunks)cypress/fixtures/users.json
(1 hunks)
🧰 Additional context used
📓 Learnings (1)
cypress/e2e/patient_spec/patient_details.cy.ts (2)
Learnt from: nihal467
PR: ohcnetwork/care_fe#9285
File: cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts:17-17
Timestamp: 2024-12-04T07:06:49.613Z
Learning: In `PatientDoctorNotes.cy.ts`, the login methods `loginManuallyAsNurse()` and `loginByRole("nurse")` serve different purposes and approaches. Refactoring `loginManuallyAsNurse()` to use `loginByRole()` is not necessary in this context.
Learnt from: nihal467
PR: ohcnetwork/care_fe#10287
File: cypress/e2e/patient_spec/patient_creation.cy.ts:102-109
Timestamp: 2025-01-30T11:35:56.668Z
Learning: In Cypress tests, when using `cy.session`, a single `loginByApi` call in the `before` hook is sufficient as Cypress automatically handles session creation and restoration. Additional login calls in `beforeEach` are redundant.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: cypress-run (1)
🔇 Additional comments (1)
cypress/e2e/patient_spec/patient_details.cy.ts (1)
11-11
: LGTM! Role change looks good.The change from "doctor" to "devdoctor" aligns with the updated user fixtures.
CARE
|
Project |
CARE
|
Branch Review |
cypress-fixtures
|
Run status |
|
Run duration | 06m 23s |
Commit |
|
Committer | Mohammed Nihal |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
11
|
View all changes introduced in this branch ↗︎ |
@nihal467 Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌 |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit