The app I'm testing has some elements hidden initially. They will display via CSS when hovering over a separate element:
.thread_options{
display: none;
}
.btn_thread_options:hover .thread_options{
display: inline;
}
When you hover over the .btn_thread_options element, some links are displayed that I want Capybara to click on. Attempting to click these without doing anything using click_link "Send Response" gives me the error:
Failure/Error: click_link("Send Response")
Selenium::WebDriver::Error::ElementNotVisibleError:
Element is not currently visible and so may not be interacted with
Trying to use other ways of clicking it like
page.execute_script("$('.btn_thread_options').trigger('mouseover')")
Doesn't work either (same result).
Nor does clicking the item first to try to force it to be moused over:
page.find(".btn_thread_options").click
Is there any way to get this to work correctly?
opacity: 0would really work since the hidden elements will submit the form and I don't want people to accidentally click on what appears to be whitespace, and end up submitting something they didn't mean to. My work-around for now is to hide/show with jquery on mouseover and mouseout, as you mention... but it'd be nice if I could just keep it in the css :p - nzifnab