Unable to trigger mouse event in Capybara test

后端 未结 6 1405
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:21

    As well as using either find('#element').hover or page.execute_script "$('#element_2').trigger('mouseover');" one must also pass js: true to the describe block in order to turn on javascript (unless you've done that in your configuration). This tripped me up for a bit.

提交回复
热议问题