I need help
My page object structure is like below
const MENU_BUTTON = '.mat-icon[_ngcontent-nci-c6]';
class TopNavigationBar {
get menuButton() {
return cy.get(MENU_BUTTON);
}
}
export default TopNavigationBar
I added a custom command to check that any element's text
// Code in command.js
Cypress.Commands.add('shouldContain', (selector, text) => {
selector.should('contain', text);
})
and I tried to use this command but its not working
I tried to use the custom command like below
export function displayUserProfileMenu () {
cy.shouldContain(topNavigationBar.menuButton, 'automationbetelgeuseqa')
};
can anyone please provide the solution?