Method: Capybara::Node::Actions#choose
- Defined in:
- lib/capybara/node/actions.rb
#choose([locator], **options) ⇒ Capybara::Node::Element
Find a descendant radio button and mark it as checked. The radio button 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 choose a descendant radio button with a name, id, or label text matching 'Male'
page.choose('Male')
# will choose `el` if it's a radio button element
el.choose()
122 123 124 |
# File 'lib/capybara/node/actions.rb', line 122 def choose(locator = nil, **) _check_with_label(:radio_button, true, locator, **) end |