Skip to content

Commit

Permalink
Merge branch 'develop' into issue-1596
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzy11 authored Feb 24, 2025
2 parents edc9525 + bb54f17 commit 142ea9c
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 167 deletions.
4 changes: 4 additions & 0 deletions frontend/cypress/e2e/labNumberManagement.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ describe("Lab Number Management", function () {
labNumMgtPage = adminPage.goToLabNumberManagementPage();
});

it("Validate Page Visibility", function () {
labNumMgtPage.verifyPageLoaded();
});

it("User selects legacy lab number type and submits", function () {
cy.get("@labNMData").then((labNumberManagementData) => {
labNumMgtPage.selectLabNumber(
Expand Down
13 changes: 5 additions & 8 deletions frontend/cypress/pages/AdminPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ class AdminPage {

//lab number management
goToLabNumberManagementPage() {
// Click on the element using the provided selector
cy.get("a.cds--side-nav__link[href='#labNumber']")
.should("be.visible")
.click();
cy.get("[data-cy='labNumberMgmnt']").should("be.visible");
cy.get("[data-cy='labNumberMgmnt']").click();

cy.url().should("include", "#labNumber");
cy.contains("Lab Number Management").should("be.visible");
Expand All @@ -24,11 +22,10 @@ class AdminPage {

//global menu configuration
goToGlobalMenuConfigPage() {
// Expand the dropdown by clicking the button with the expanded state
cy.contains("span", "Menu Configuration").click();
cy.get("ul.cds--side-nav__menu").should("be.visible"); // Ensure the dropdown menu is visible
// Click the link for "Global Menu Configuration"
cy.get('a.cds--side-nav__link[href="#globalMenuManagement"]').click(); // Click the "Global Menu Configuration" link
//cy.get("[data-cy='menuConfig']").click();
cy.get("[data-cy='globalMenuMgmnt']").should("be.visible");
cy.get("[data-cy='globalMenuMgmnt']").click();

// Verify the URL and the visibility of the content
cy.url().should("include", "#globalMenuManagement");
Expand Down
15 changes: 9 additions & 6 deletions frontend/cypress/pages/BatchOrderEntryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ class BatchOrderEntry {
}

typeLabNumber(labNumber) {
cy.wait(10000);
cy.get('[placeholder="Enter Lab Number"]')
.should("be.visible")
.type(labNumber);
cy.wait(200);
cy.get("#labNo").should("be.visible");
cy.get("#labNo").type(labNumber);
}

uniqueHealthIDNum(healthID) {
Expand Down Expand Up @@ -103,7 +102,7 @@ class BatchOrderEntry {
cy.contains("span", "Female").click();
}
checkNextButtonEnabled() {
cy.contains("button", "Next").wait(10000).click();
cy.get("[data-testid='next-button-BatchOrderEntry']").wait(500).click();
}

selectDNAPCRTest() {
Expand All @@ -119,10 +118,14 @@ class BatchOrderEntry {
}

clickNewPatientButton() {
//the #newPatient is not responding
cy.contains("button", "New Patient").should("be.visible");
cy.contains("button", "New Patient").click();
}

clickSearchPatientButton() {
//the #searchPatient is not responding
cy.contains("button", "Search for Patient").should("be.visible");
cy.contains("button", "Search for Patient").click();
}

Expand All @@ -147,7 +150,7 @@ class BatchOrderEntry {
}

clickFinishButton() {
cy.contains("button", "Finish").click();
cy.get("[data-cy='finishButton']").click();
}
}

Expand Down
6 changes: 2 additions & 4 deletions frontend/cypress/pages/LabNumberManagementPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ class LabNumberManagementPage {
constructor() {}

verifyPageLoaded() {
// Confirm the page is loaded by checking a unique element
cy.contains("Lab Number Management").should("be.visible");
cy.contains("h2", "Lab Number Management").should("be.visible");
}

selectLabNumber(labNumberType) {
// Ensure the dropdown is visible and interactable
cy.get("#lab_number_type").should("be.visible").select(labNumberType); // Select the lab number type passed as an argument
}

checkPrefixCheckBox() {
cy.get("#usePrefix").check({ force: true }); // Check the checkbox
cy.get("#usePrefix").check({ force: true });
}
typePrefix(prefix) {
this.checkPrefixCheckBox();
Expand Down
6 changes: 2 additions & 4 deletions frontend/cypress/pages/PatientEntryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PatientEntryPage {
}

clickNewPatientTab() {
cy.get(":nth-child(1) > :nth-child(2) > .cds--btn").click();
cy.get("#newPatient").click();
}

enterPatientInfo(
Expand All @@ -49,9 +49,7 @@ class PatientEntryPage {
}

getMaleGenderRadioButton() {
return cy.getElement(
":nth-child(2) > .cds--radio-button__label > .cds--radio-button__appearance",
);
return cy.contains("span", "Male").click();
}

clickSearchPatientButton() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/cypress/pages/WorkPlan.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class WorkPlan {
return cy.get("button#print");
}
getWorkPlanResultsTable() {
return cy.get('[data-set-id="workplanResultsTable"]');
return cy.get('[data-cy="workplanResultsTable"]');
}
}
export default WorkPlan;
12 changes: 10 additions & 2 deletions frontend/src/components/admin/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ function Admin() {
<SideNavLink href="#AnalyzerTestName" renderIcon={ListDropdown}>
<FormattedMessage id="sidenav.label.admin.analyzerTest" />
</SideNavLink>
<SideNavLink href="#labNumber" renderIcon={CharacterWholeNumber}>
<SideNavLink
data-cy="labNumberMgmnt"
href="#labNumber"
renderIcon={CharacterWholeNumber}
>
<FormattedMessage id="sidenav.label.admin.labNumber" />
</SideNavLink>
<SideNavLink renderIcon={ChartBubble} href="#program">
Expand Down Expand Up @@ -161,10 +165,14 @@ function Admin() {
<FormattedMessage id="master.lists.page.test.management" />
</SideNavLink>
<SideNavMenu
data-testid="menuConfig"
title={intl.formatMessage({ id: "sidenav.label.admin.menu" })}
renderIcon={TableOfContents}
>
<SideNavMenuItem href="#globalMenuManagement">
<SideNavMenuItem
data-cy="globalMenuMgmnt"
href="#globalMenuManagement"
>
<FormattedMessage id="sidenav.label.admin.menu.global" />
</SideNavMenuItem>
<SideNavMenuItem href="#billingMenuManagement">
Expand Down
Loading

0 comments on commit 142ea9c

Please sign in to comment.