-
Notifications
You must be signed in to change notification settings - Fork 516
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
Enhanced Resource Page #9768
Open
manmeetnagii
wants to merge
25
commits into
ohcnetwork:develop
Choose a base branch
from
manmeetnagii:enhanced-resource-page
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Enhanced Resource Page #9768
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
5d5dbd8
enhanced-resource-page
manmeetnagii 66126a4
enhanced-resource-page
manmeetnagii 59f2f4c
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii e9193ad
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 85de07b
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 336d4d2
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 7f8aab4
enhanced-resource-page
manmeetnagii baa6957
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 774d885
removed console logs
manmeetnagii f83d81e
stored viewMode to localStorage
manmeetnagii 09429b2
switch to useQuery for all api calls
manmeetnagii 5ed698b
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 50d2528
changes for mobile screen
manmeetnagii 93a31c5
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 103337d
fix list view layout
manmeetnagii 46e610c
Fixed the count of status
manmeetnagii 82514c4
Fixed the count of status
manmeetnagii 56e4036
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii bafcb02
Fixed position of resource cards wrt their status
manmeetnagii eea4ac6
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 076f15b
Merge branch 'develop' into enhanced-resource-page
manmeetnagii e427ed8
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
manmeetnagii 4965b31
Merge branch 'enhanced-resource-page' of https://github.com/manmeetna…
manmeetnagii cc5e17a
Resolved conflicts
manmeetnagii 8718369
Resolved conflicts
manmeetnagii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { patientSearch } from "../../pageObject/Patients/PatientSearch"; | ||
|
||
describe("Patient Search", () => { | ||
const TEST_PHONE = "9495031234"; | ||
const PATIENT_DETAILS = { | ||
name: "Nihal", | ||
sex: "Male", | ||
phone: TEST_PHONE, | ||
}; | ||
|
||
beforeEach(() => { | ||
cy.visit("/login"); | ||
cy.loginByApi("staff"); | ||
}); | ||
|
||
it("search patient with phone number and verifies details", () => { | ||
patientSearch | ||
.selectFacility("Arike") | ||
.clickSearchPatients() | ||
.searchPatient(TEST_PHONE) | ||
.verifySearchResults(PATIENT_DETAILS); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
export class PatientSearch { | ||
// Selectors | ||
private selectors = { | ||
patientsButton: '[data-cy="patients-button"]', | ||
searchInput: "#patient-search", | ||
patientCard: "#patient-search-results", | ||
patientName: '[data-cy="patient-name"]', | ||
patientDetails: "#patient-search-results", | ||
}; | ||
|
||
// Actions | ||
searchPatient(searchQuery: string) { | ||
cy.get(this.selectors.searchInput).type(searchQuery); | ||
|
||
// Wait for results to load | ||
cy.get(this.selectors.patientCard).should("be.visible"); | ||
return this; | ||
} | ||
|
||
verifySearchResults(patientDetails: { | ||
name: string; | ||
sex: string; | ||
phone: string; | ||
}) { | ||
// Convert object values to an array of strings | ||
const detailsArray = Object.values(patientDetails); | ||
cy.verifyContentPresence(this.selectors.patientDetails, detailsArray); | ||
} | ||
|
||
selectFacility(facilityName: string) { | ||
cy.verifyAndClickElement("[data-cy='facility-list']", facilityName); | ||
return this; | ||
} | ||
|
||
clickSearchPatients() { | ||
cy.get('[data-sidebar="content"]').contains("Search Patients").click(); | ||
return this; | ||
} | ||
} | ||
|
||
export const patientSearch = new PatientSearch(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
💡 Codebase verification
🛠️ Refactor suggestion
Add error handling and test coverage for edge cases
The page object and test suite need improvements:
PatientSearch
page object lacks error handling:Add the following test cases:
🔗 Analysis chain
Add error scenarios and edge cases.
While the happy path is covered, consider adding test cases for:
Also, verify that the
patientSearch
page object implements proper error handling:🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 80
Script:
Length of output: 6141