-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
- Loading branch information
Showing
25 changed files
with
275 additions
and
58 deletions.
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import LoginPage from "../pages/LoginPage"; | ||
|
||
let loginPage = null; | ||
let homePage = null; | ||
let adminPage = null; | ||
let labNumMgtPage = null; | ||
|
||
before(() => { | ||
// Initialize LoginPage object and navigate to Admin Page | ||
loginPage = new LoginPage(); | ||
loginPage.visit(); | ||
|
||
homePage = loginPage.goToHomePage(); | ||
adminPage = homePage.goToAdminPage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
// Load fixture data for each test | ||
cy.fixture("LabNumberManagement").as("labNMData"); | ||
}); | ||
|
||
describe("Lab Number Management", function () { | ||
it("User navigates to the Lab Number Management page", function () { | ||
labNumMgtPage = adminPage.goToLabNumberManagementPage(); | ||
}); | ||
|
||
it("User selects legacy lab number type and submits", function () { | ||
cy.get("@labNMData").then((labNumberManagementData) => { | ||
labNumMgtPage.selectLabNumber( | ||
labNumberManagementData.legacyLabNumberType, | ||
); | ||
labNumMgtPage.clickSubmitButton(); | ||
}); | ||
}); | ||
|
||
it("User selects alpha numeric lab number type and submits", function () { | ||
cy.get("@labNMData").then((labNumberManagementData) => { | ||
labNumMgtPage.selectLabNumber(labNumberManagementData.alphaLabNumberType); | ||
labNumMgtPage.checkPrefixCheckBox(); | ||
labNumMgtPage.typePrefix(labNumberManagementData.userPrefix); | ||
labNumMgtPage.clickSubmitButton(); | ||
}); | ||
}); | ||
}); |
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,5 @@ | ||
{ | ||
"alphaLabNumberType": "Alpha Numeric", | ||
"legacyLabNumberType": "Legacy", | ||
"userPrefix": "REG-" | ||
} |
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,33 @@ | ||
//This handles all pages of the admin | ||
import LabNumberManagementPage from "./LabNumberManagementPage"; | ||
|
||
class AdminPage { | ||
constructor() {} | ||
|
||
visit() { | ||
cy.visit("/administration"); //need to confirm this | ||
} | ||
//this page is also included in the homepage | ||
goToAdminPage() { | ||
this.openNavigationMenu(); | ||
cy.get("#menu_administration").click(); | ||
cy.get("#menu_administration_nav").click(); | ||
return new 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") // Ensure the element is visible | ||
.click(); // Click to navigate to the page | ||
|
||
// Verify the URL or some unique identifier of the target page | ||
cy.url().should("include", "#labNumber"); // Validate URL fragment | ||
cy.contains("Lab Number Management").should("be.visible"); // Confirm presence of the page content | ||
|
||
return new LabNumberManagementPage(); // Return the page object | ||
} | ||
} | ||
|
||
export default AdminPage; |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class LabNumberManagementPage { | ||
constructor() {} | ||
|
||
verifyPageLoaded() { | ||
// Confirm the page is loaded by checking a unique element | ||
cy.contains("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 | ||
} | ||
typePrefix(prefix) { | ||
this.checkPrefixCheckBox(); | ||
|
||
// Wait for the input to become enabled | ||
cy.get("#alphanumPrefix").should("not.be.disabled").type(prefix); | ||
} | ||
clickSubmitButton() { | ||
cy.get("button.cds--btn.cds--btn--primary[type='submit']") | ||
.should("be.visible") | ||
.click(); | ||
} | ||
} | ||
|
||
export default LabNumberManagementPage; |
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
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
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
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
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
Oops, something went wrong.