I have a problem getting Cucumber to search for fields with HTML5 type="number" . I'm not a big fan of how they look in the browser, but I have a few fields that need a numeric keypad on a mobile phone, and this seems to be the easiest way to get it. I use SimpleForm to create forms, and when I set :as => :text , everything works, but if I set :as => :number , the fields are not populated. I do not get any errors, the field simply does not fill out.
To be specific, when I have such a step:
And I fill in "application_form_age" with "52"
then this tag will not be filled:
<input class=β"numeric integer required" id=β"application_form_age" min=β"0" name=β"application_form[age]β" size=β"50" step=β"1" type=β"number">β
but it works:
<input class=β"string required" id=β"application_form_age" name=β"application_form[age]β" size=β"50" type=β"text">β
Also, this only happens in @javascript scripts. In situations where @javascript is not needed and the script does not launch the browser, this works fine too.
Versions of things:
capybara (2.2.1) cucumber (1.3.14) selenium-webdriver (2.41.0) simple_form (2.1.1) webrat (0.7.3) Firefox 29.0
I'm at a dead end. I tried pulling out a bunch of my JS and CSS application to find out if something that I am doing is working but no luck with that. I just fix this by forcing these fields to not have HTML5 type numbers in my test environment, but I don't want to live like that. Does anyone else see this? I could not find any references to it, which makes me seem like something that I am doing. But I could not understand it.
ruby selenium cucumber capybara
Steve
source share