I have an input field with an id which has a value. The web_steps.rb
method
does not find the value. Is this the right step to use to check an input
field? It works fine for a text_area but not an input.
Scenario steps (tried both ways):
Then the “travel_card_number_gate” field should contain “5”
Then the “#travel_card_number_gate” field should contain “5”
From web_steps.rb
Then /^the “([^”])" field(?: within “([^”])")? should contain
“([^”]*)"$/ do |field, selector, value|
with_scope(selector) do
field = find_field(field)
field_value = (field.tag_name == ‘textarea’) ? field.text :
field.value
if field_value.respond_to? :should
field_value.should =~ /#{value}/
else
assert_match(/#{value}/, field_value)
end
end
end