-
Notifications
You must be signed in to change notification settings - Fork 522
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
Refactor Facility Export & Add New Sidebar collapse & expand Test #9066
Closed
ghost
wants to merge
16
commits into
ohcnetwork:develop
from
Alokih:issues/9043/sidebar-collapse-test
Closed
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9ad063c
Refactor Facility export & Add sidebar collapse test
be0448e
Merge branch 'develop' into issues/9043/sidebar-collapse-test
eb07939
Merge branch 'develop' into issues/9043/sidebar-collapse-test
287e353
Merge branch 'develop' into issues/9043/sidebar-collapse-test
afa760c
verifies icons & its responsive text
5f57f05
Merge branch 'develop' into issues/9043/sidebar-collapse-test
3d06dba
added coderabbit suggestions to reduce duplicates
8b2fb07
Merge branch 'develop' into issues/9043/sidebar-collapse-test
495a476
Merge branch 'develop' into issues/9043/sidebar-collapse-test
4503dae
Merge branch 'develop' into issues/9043/sidebar-collapse-test
9d65b4f
Merge branch 'develop' into issues/9043/sidebar-collapse-test
6383d75
Merge branch 'ohcnetwork:develop' into issues/9043/sidebar-collapse-test
19a6609
Merge branch 'ohcnetwork:develop' into issues/9043/sidebar-collapse-test
bbe15ed
Verify exact text for icons fix
5a66406
Merge branch 'develop' into issues/9043/sidebar-collapse-test
nihal467 9da4ef4
Merge branch 'develop' into issues/9043/sidebar-collapse-test
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 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 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 |
---|---|---|
|
@@ -4,6 +4,9 @@ class FacilityHome { | |
searchButton = "#search"; | ||
menuItem = "[role='menuitem']"; | ||
|
||
sidebarToggle = () => cy.get('[data-testid="sidebar-toggle"]'); | ||
sidebarItems = () => cy.get('[data-testid="sidebar-item"]'); | ||
|
||
// Operations | ||
clickExportButton() { | ||
cy.get(this.exportButton).scrollIntoView(); | ||
|
@@ -104,6 +107,33 @@ class FacilityHome { | |
const encodedText = encodeURIComponent(searchText).replace(/%20/g, "+"); | ||
this.getURL().should("include", `search=${encodedText}`); | ||
} | ||
|
||
toggleSidebar() { | ||
this.sidebarToggle().should("be.visible").click(); | ||
} | ||
|
||
private verifySidebarElements( | ||
textVisibility: "be.visible" | "not.be.visible", | ||
) { | ||
this.sidebarItems() | ||
.should("have.length.at.least", 1) | ||
.each(($item) => { | ||
cy.wrap($item, { timeout: 10000 }) | ||
.find('[data-testid="sidebar-icon"]') | ||
.should("be.visible"); | ||
cy.wrap($item, { timeout: 10000 }) | ||
.find('[data-testid="sidebar-text"]') | ||
.should(textVisibility); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned earlier, ensure that the exact text is verified. For example, confirm that the text corresponding to the facility icon is precisely "Facilities" and not just any visible text. Similarly, verify the exact text for other icons as well. |
||
}); | ||
} | ||
|
||
verifyIconsAndTextVisible() { | ||
this.verifySidebarElements("be.visible"); | ||
} | ||
|
||
verifyIconsVisibleAndTextHidden() { | ||
this.verifySidebarElements("not.be.visible"); | ||
} | ||
} | ||
|
||
export default FacilityHome; |
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 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
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.