I have a few text fields which when I login as a specific user (rights of a read only) , all the text fields are not allowed to be edited. I am trying to automate this page in Cypress.
I tried using :
cy.get(element).should("be.disabled")
cy.get(element).should("have.text", readonly,readonly).
Both failed.
Please let me know if anyone has any other options.
readonly
set (is that what you're trying to test with"have.text"
)? Something else (e.g. code behind just ignores whatever the user tries to type in)?