Trouble interacting with Bootstrap modals via Capybara (v2)

前端 未结 4 2119
无人及你
无人及你 2021-01-01 22:07

In a Rails application I\'m trying to test a Bootstrap modal with a jQuery TokenInput field in Rspec using Capybara with the capybara-webkit driver. The portion

4条回答
  •  死守一世寂寞
    2021-01-01 22:27

    We just do this and it seems to work (for example to click on $('.tp-header-login'):

    # instead of find(".tp-header-login")
    
    find(".tp-header-login") # still do the find so you are sure its loaded then...
    execute_script "$('.tp-header-login').click()"
    

提交回复
热议问题