-
Notifications
You must be signed in to change notification settings - Fork 444
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
Modified the Address Variable to use real-world data in cypress test #9218
Conversation
WalkthroughThe changes in this pull request involve updates to patient details in two files: Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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 (
|
✅ 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: 3
🧹 Outside diff range and nitpick comments (3)
cypress/pageobject/Patient/PatientPredefined.ts (1)
22-24
: Consider moving test data to constantsThe hardcoded address string would be better maintained in a constants file along with other test data. This would make it easier to update and reuse across different test files.
Consider creating a new constants file for test data:
// cypress/fixtures/testData.ts export const TEST_ADDRESSES = { BANGALORE: "149/J, 3rd Block, Koramangala, Karnataka - 560034", KERALA: "42/1234, Changampuzha Nagar, Edappally, Kerala - 682024", };Then import and use it in your test:
+ import { TEST_ADDRESSES } from "../../fixtures/testData"; - patientPage.typePatientAddress( - "149/J, 3rd Block, Koramangala, Karnataka - 560034", - ); + patientPage.typePatientAddress(TEST_ADDRESSES.KERALA);cypress/e2e/patient_spec/PatientRegistration.cy.ts (2)
43-43
: Consider using more realistic test data for patient nameThe test patient name "Great Napolean 14" has several issues:
- Contains an unusual number suffix
- Has a typo in "Napolean" (correct spelling is "Napoleon")
- Capitalization seems non-standard
Consider using a more realistic name for test data:
- const patientOneName = "Great Napolean 14"; + const patientOneName = "John Doe";
46-48
: Consider using a single-line address formatThe multi-line template literal for the address might cause issues in some test scenarios and makes the code less maintainable.
- const patientOneAddress = `149/J, 3rd Block, - Koramangala - Bangalore, Karnataka - 560034`; + const patientOneAddress = "149/J, 3rd Block, Koramangala, Bangalore, Karnataka - 560034";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
cypress/e2e/patient_spec/PatientRegistration.cy.ts
(1 hunks)cypress/pageobject/Patient/PatientPredefined.ts
(1 hunks)
patientPage.typePatientAddress( | ||
"149/J, 3rd Block, Koramangala, Karnataka - 560034", | ||
); |
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.
Address and state details are inconsistent
The address specifies a location in Karnataka (Koramangala, Bangalore), but the subsequent form fills Kerala state details (Ernakulam district). This inconsistency could lead to test failures if there's address validation in place.
Consider either:
- Using a Kerala address to match the state/district selection, or
- Updating the state/district selection to match the Karnataka address
- patientPage.typePatientAddress(
- "149/J, 3rd Block, Koramangala, Karnataka - 560034",
- );
- facilityPage.fillPincode("682001");
- facilityPage.selectStateOnPincode("Kerala");
- facilityPage.selectDistrictOnPincode("Ernakulam");
+ // Option 1: Use Kerala address
+ patientPage.typePatientAddress(
+ "42/1234, Changampuzha Nagar, Edappally, Kerala - 682024"
+ );
+ facilityPage.fillPincode("682024");
+ facilityPage.selectStateOnPincode("Kerala");
+ facilityPage.selectDistrictOnPincode("Ernakulam");
Committable suggestion skipped: line range outside the PR's diff.
Deploying care-fe with Cloudflare Pages
|
CARE Run #3956
Run Properties:
|
Project |
CARE
|
Branch Review |
modified-cypress
|
Run status |
Passed #3956
|
Run duration | 05m 25s |
Commit |
3b3ee935f8: Modified the Address Variable to use real data in cypress test
|
Committer | Mohammed Nihal |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
135
|
View all changes introduced in this branch ↗︎ |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
Bug Fixes
Chores