Ruby on rails 水豚/恶灵不会让悬停的元素保持可见

Ruby on rails 水豚/恶灵不会让悬停的元素保持可见,ruby-on-rails,capybara,automated-tests,poltergeist,Ruby On Rails,Capybara,Automated Tests,Poltergeist,我正在尝试使用CapybaraV2.4.3和PoltergeistV1.5.1建立一个自动化测试套件 我的问题是,恶鬼需要点击一个img,这是一个链接,只有当你们将鼠标悬停在另一个元素上时才可见。请看链接中的屏幕截图 很抱歉,我还不能上传图片,所以我在上面链接了我的截图 我使用以下命令公开这些隐藏图像: find('div#userlogin div.colorswitch_languageswitch a.btn_earth').hover 整个测试是这样的 it 'switches lan

我正在尝试使用CapybaraV2.4.3和PoltergeistV1.5.1建立一个自动化测试套件

我的问题是,恶鬼需要点击一个img,这是一个链接,只有当你们将鼠标悬停在另一个元素上时才可见。请看链接中的屏幕截图

很抱歉,我还不能上传图片,所以我在上面链接了我的截图

我使用以下命令公开这些隐藏图像:

find('div#userlogin div.colorswitch_languageswitch a.btn_earth').hover
整个测试是这样的

it 'switches language to english', focus: true, js: true do
    find('div#userlogin div.colorswitch_languageswitch a.btn_earth').hover
    save_and_open_screenshot # to ensure the flags are displayed, this works
    within('div#language_flags') do
        click_link('Language_usa') # when I try to click it doesn't switch languages
    end
    page.should have_content('Login name (email)')
    page.should have_content('Forgot password?')
end
我已经打开了poltergeist的调试功能,看起来poltergeist正在点击正确的坐标,但没有点击链接

在此之后,我稍微更改了视图并删除了display:none样式属性,因此需要单击的图像始终可见。现在考试通过了

所以我的问题是:如何让恶鬼在鼠标悬停父元素后像用户那样将鼠标移动到图像上,这样它们就不会消失


PS:如果我忘记了重要信息,请告诉我

没有解决方案吗?我不知道到目前为止。。。。我现在正在使用selenium进行此测试