Method: Capybara::Node::Actions#check
- Defined in:
- lib/capybara/node/actions.rb
#check([locator], **options) ⇒ Capybara::Node::Element
Find a descendant check box and mark it as checked. The check box can be found via name, id, test_id attribute, or label text. If no locator is provided this will match against self or a descendant.
# will check a descendant checkbox with a name, id, or label text matching 'German'
page.check('German')
# will check `el` if it's a checkbox element
el.check()
150 151 152 |
# File 'lib/capybara/node/actions.rb', line 150 def check(locator = nil, **) _check_with_label(:checkbox, true, locator, **) end |