Last active
May 17, 2019 19:49
-
-
Save gbpereira/0a2b526970a40ccb38842355de97e92c to your computer and use it in GitHub Desktop.
Useful commands to work with capybara and rails
This file contains hidden or 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
# trigger event | |
def trigger_event(jquery_element, event) | |
page.execute_script("$('#{jquery_element}').trigger('#{event}')") | |
end | |
# write html page to file | |
File.write('output.html', page.html) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment