I want to check if a checkbox is checked using cucumber and capybara. I have checked the checkbox in my previous step and want to verify it by obtaining the value of the checkbox.
Use the checked?
method
e.g.:
my_box = find('#some_checkbox') my_box.should be_checked # Before Rspec 2.11 # OR using new syntax expect(my_box).to be_checked # Rspec 2.11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With