How to emulate mouse hover with Capybara

前端 未结 4 1193
北荒
北荒 2020-12-13 06:27

Basically, what I\'m trying to do is click on a button that becomes visible when hovering another element (its parent).

I have tried to use trigger.(\'mouseove

4条回答
  •  渐次进展
    2020-12-13 06:44

    Alex described the solution of such problems in his blog: check it out http://aokolish.me/blog/2012/01/22/testing-hover-events-with-capybara

    RSpec.configure do |config|
      # ...
      Capybara.javascript_driver = :webkit
    end
    
    page.find('#element').trigger(:mouseover)
    

提交回复
热议问题