- 
      
- 
        Save bowsersenior/1652360 to your computer and use it in GitHub Desktop. 
    Trigger javascript event in Capybara
  
        
  
    
      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
    
  
  
    
  | module JQueryEventsHelpers | |
| def trigger_js_event(selector, event) | |
| script = "$('#{selector}').trigger('#{event}')" | |
| page.execute_script(script); | |
| end | |
| end | |
| World(JQueryEventsHelpers) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment