Posted over 9 years ago. Visible to the public.

Cucumber: Check if a select field contains a disabled option

For Capybara, use this step:

Copy
Then /^"([^"]*)" should be a disabled option for "([^"]*)"(?: within "([^\"]*)")?$/ do |value, field, selector| with_scope(selector) do field_labeled(field).find(:xpath, ".//option[text() = '#{value}'][@disabled]").should be_present end end

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Dominik Schöler
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Dominik Schöler to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more