Reputation: 1061
How do I check the DOM properties of an element I've selected with Capybara? (note that this is different from checking attributes)
Example: I want to see if a checkbox is in the indeterminate state, and I'd like to do something like this:
find('input[type="checkbox"]').properties.indeterminate == true
Upvotes: 1
Views: 182
Reputation: 1061
Looks like the best method I have is JavaScript:
def has_indeterminate_field?(text)
page.evaluate_script "$('label:contains(#{text}) input')[0].indeterminate"
end
Upvotes: 1