able-twilight-99822
05/18/2023, 9:45 AMFeature: Admin Menu Navigation
Scenario: Navigate to the Admin Levels
When I select the 'Admin' Menu
2. Observe the Cypress Test Runner GUI.
Expected Result:
The 'Admin' menu item should be successfully selected without any errors, allowing navigation to the Admin levels.
Actual Result:
The test fails with a timeout error, indicating that properties of undefined cannot be read. This issue occurs when trying to locate the 'Admin' menu item using the [label="Admin"] selector.
Additional Information:
- The test code consists of the following files:
- **testFile.js**:
javascript
When('I select the {string} Menu', (sideMenu) => {
adminPageDefinitions.selectMenu(sideMenu);
});
- **adminPageDefinitions.js**:
javascript
import adminPage from './adminPage';
export const adminPageDefinitions = {
selectMenu(sideMenu) {
cy.get(adminPage.pageElements.sideMenu(sideMenu))
.should('be.visible')
.click();
},
};
- **adminPage.js**:
javascript
const adminPage = {
pageElements: {
sideMenu(sideMenu) {
return cy.get(`[label="${sideMenu}"]`);
},
},
};
- The error occurs at the line cy.get(adminPage.pageElements.sideMenu(sideMenu)).should('be.visible').click(); in the adminPageDefinitions.js file.
- Manually inspecting the page confirms that the menu item with the label "Admin" exists and is visible.