ruby on rails - How to easily uncheck all checkboxes with Capybara -
I have a list of checkboxes that have been created using.
When it is tested in a feature / integration test, using CAPABAR, and want to make the page "normal" by unchecking them all, then I want to check:
inner_foldset ('product') # Reset all checkboxes for a level gamefield. # What to do? Enable check boxes for # products. Manufacturer | Products | This is in a so-called PageObject, so I want some generality: it was in real test, I would have known which fields were examined and unchecked them. But this more general assistant has no such knowledge. I have tried on the lines of ('input [type = checkbox]'). All {| Checkbox | Uncheck (checkbox)}
, which should work but gets complicated complexly, does not it?
Is something uncheck_all ()?
, in Capepara? Does it have a similar pattern to "reset" a form in Capepara in an empty position before it starts in fill_in forms?
Try this:
all ('input [type = checkbox] ]] '). Do each. Checkbox | If checkbox Checked? Then checkbox. Click End End
Comments
Post a Comment