dimanche 3 juillet 2022

How to check mat-checkbox based on label during Cypress test?

Is it possible to check a mat-checkbox in a Cypress test based on it's label text?

Below is the HTML for the checkbox:

enter image description here

I have several checkboxes to test, so I want to re-use code to do something like - When I check the 'Advanced search' checkbox, When I check the 'Basic search' checkbox, etc.




Aucun commentaire:

Enregistrer un commentaire