Created
December 14, 2010 11:19
-
-
Save martinhawkins/740282 to your computer and use it in GitHub Desktop.
Cucumber step definition to detect whether a disabled select option exists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /^"([^"]*)" from "([^"]*)" within "([^"]*)" should be disabled$/ do |option_name, type_label, selector| | |
with_scope(selector) do | |
x=page.find(:xpath, '//body').all(:xpath, XPath.generate { |x| x.descendant(:select).descendant(:option)[x.attr(:disabled) == 'disabled'] }) | |
x.collect(&:text).should include(option_text) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment