Closed will closed 5 years ago
@will Yes - Apparition supports a delay
option when filling in text fields. You can do
fill_in "cc-number", with: "4242424242424242", fill_options: { delay: 0.1 }
to wait 0.1 seconds between each key press. If you have already found the element then you could also do
element = find('#cc-number')
...
element.set("4242424242424242", delay: 0.1)
Thank you!
Hah, I had exactly this issue down to the 4242424242424242 string. Thanks!
Is there a way to get fill_in to type more slowly? I have a form that uses some javascript form Stripe to verify credit card checksums or whatever it does and that seems to be slow enough that numbers are skipped when filling in that field.
Notice the repeated
4
s when the literal is all alternating.When running in not-headless, it doesn't fail, I guess because actually rendering the input is slow enough, whereas in headless it can go faster.
In the meantime I've worked around this by making a helper that cheats by directly setting the value property, but I'm wondering if there is another way that would be "better"?