Am new to cypress and been trying to validate an error message that appears on UI after clicking on a button
I've tried the following 3 but neither of them worked
cy.get('pvd-system-message').should('have.text', 'SSN 123456789 not found ')
cy.contains('SSN 123456789 not found').should('be.visible')
cy.contains('pvd-system-message', 'SSN 123456789 not found ')
Any help would be really appreciated, thank you!
Please check the screenshot here Screenshot of UI and elements
You have a
#shadow-root
in the image, take a look at the .shadow() examples.One of these should work