ruby-on-railsrspeccapybarajquery-tooltip

Capybara for testing tooltip contents fails randomly only in Semaphore


My specs passes in local. But the below code fails in Semaphore CI.
- Included js: true
- Tried increasing the Capybara.default_wait_time to 5, but still no luck.

Here is my code:

find(".tooltip-#{user.id}").hover
expect(page).to have_content user.tooltip_content

Any idea how this can be resolved.


Solution

  • You can try

    page.execute_script('$(".tooltip-#{user.id}").mouseover()')

    expect(page).to have_content user.tooltip_content