# ... scenario 'test some js behavior', js: true do visit some_path ensure_js_is_ready # JS is fully loaded you can start interacting with the page end # ...