Capybara's native#send_key function is slow when it is passed a string
longer than just a few characters. This often results in timeout issues
and Capybara (falsely) reporting feature as failing.
To fix this, we use the faster function #fill_in. This does not trigger
JavaScript events on the input, so we manually trigger them after
fill_in by just sending a single key. This can be any key but since we
do not want to modify the text in the input, non-text keys should be
used. For a list of non-text keys, see
http://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FNode%2FElement%3Asend_keys
There is an alternative to the above:
1) Use #fill_in to enter all text except for the last character:
fill_in ..., with: "#{status_message_text} #{txt[0..-2]}"
2) And then use #send_key to send that last character:
find("#status_message_text").native.send_key(txt.last)
At the moment, both approaches work equally well but the second approach
is documented here just in case it becomes relevant in the future.
This conversion is done by Transpec 2.3.6 with the following command:
transpec features
* 19 conversions
from: obj.should
to: expect(obj).to
* 1 conversion
from: == expected
to: eq(expected)
For more details: https://github.com/yujinakayama/transpec#supported-conversions
* removed wait_until where possible
* replaced wait_until with DOM obersavtions
* added match: :first to all finders that assumed getting the first element
* replaced evaluate_script with execute_script where possible
* replaced a few execute_script with DOM observations through Capybara
* removed sleep where possible
* replaced sleep with DOM obersvations
* replaced "wait for ajax" with DOM obersavations
* replaced alert confirmation with new selenium API
* bump selenium webdriver
* made any other fixes to get green again
Revert "ensure that time is always far beyond last post creation"
This reverts commit 749b403d13.
Revert "make Timecop travel persistent for the whole run"
This reverts commit 5d9bdd80ab.
Revert "Timecop post creation for cucumber"
This reverts commit dba3dbbfeb.