I am trying to check mat-checkbox
element with the cypress check()
method and even if add force
parameter. Example:
Cypress.Commands.add('changeEmailLayoutCheckbox', () =>
cy
.get(EMAIL_LAYOUT_CHECKBOX)
.check({ force: true })
);
I am getting the following error
cy.check() can only be called on :checkbox and :radio. Your subject is a: <mat-checkbox
The message is quite clear but the problem is that I emit some event on mat-checkbox
change, which set parameters to my request. I also have tried with click()
but those not trigger mentioned event.