Unable to trigger mouse event in Capybara test

后端 未结 6 1390
Happy的楠姐
Happy的楠姐 2021-02-12 13:15

I am using Capybara 1.0.0, and I have a link in my page which gets visible when mouse hover over that block. So I want to trigger mouse over in test so that I can click that hid

6条回答
  •  我在风中等你
    2021-02-12 13:44

    This blog has the answer:

    http://aokolish.me/blog/2012/01/22/testing-hover-events-with-capybara

    page.find('#element').trigger(:mouseover)
    

    This doesn't work with the selenium driver though:

    http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Element#trigger-instance_method

提交回复
热议问题