Skip to content
Advertisement

Verify the checkbox is checked in Cypress

I want to verify the checkbox is checked. This is the HTML for the checkbox

enter image description here

the js for it:

JavaScript

Then on step definition:

JavaScript

strangely Cypress shows that the expected value was true but the value was true

enter image description here

Advertisement

Answer

You have to change true to 'true'. The true is a string.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement