Cucumber: Check if a select field contains a disabled option

Posted . Visible to the public.

For Capybara, use this step:

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
Dominik Schöler
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2013-08-02 06:35)