I'm working on a form that contains both disabled and enabled fields.
In my current setup, I have a command that checks for disabled fields:
Cypress.Commands.add("checkElementState", (myselector) {
if(myselector) {
cy.getBySel(myselector).should('be.disabled')
})
However, this command only checks for one element at a time. How can I modify the code to support multiple testids for the same object?
Is it possible to structure it like this:
cy.checkElementState(myselector: ["first-element", "second-element", "third-element"])
Where first-element, second-element, and third-element are the testids.
Any guidance on how I can achieve this would be greatly appreciated.