Tag: capybara

Capybara测试失败,AJAX响应

我有以下的Capybara测试,它应该点击并更改评论的内容。 问题是内容表单被加载到一个模式中,该模式在单击编辑按钮时弹出,并且我的模态未在测试中呈现。 (此function适用于应用程序)。 save_and_open_page打开一个只包含json对象的页面。 feature_spec.rb require ‘spec_helper’ describe ‘Edit comment’ do let(:commented_post) { FactoryGirl.create(:post_with_comments) } describe “when current_user is the comment’s author” do it ‘should edit the comment content’ do visit post_path(commented_post) within (“#comment-#{commented_post.comments.first.id}”) do click_on “edit” end Capybara.default_wait_time = 15 save_and_open_page fill_in ‘comment_content’, with: ‘No, this is the best comment’ click_on ‘Edit Comment’ expect(page).to […]

测试jQuery Selectable水豚或selenium(ctrl +点击)

我正在使用jQuery Selectable来管理日历。 这个function非常好,只需要进入测试自动化。 我需要从日历网格中选择多个非连续日期。 我尝试了一些事情,并没有真正期待它们发挥作用 date = ‘2013-05-02′ page.execute_script %{ var e = jQuery.Event(“keydown”); e.ctrlKey = true; // # Some key code value e.keyCode = 17 $(“body”).trigger(e); } find(“td[data-date=’#{date}’]”).click 我这样做了一系列日期,但似乎没有考虑ctrl键,因为只选择了实际上选择的最后一个日期。