goodwill / capybara-select2

Helper for capybara to be able to trigger select on select2 javascript (needed for js enabled test only)
MIT License
80 stars 111 forks source link

Capybara::Webkit::ClickFailed #16

Open cbunhok opened 11 years ago

cbunhok commented 11 years ago

Dear Goodwill,

Currently, I got an new error "Capybara::Webkit::ClickFailed". Do you have any idea about this error?

Thanks & Regards, Bunhok

goodwill commented 11 years ago

No idea really, could write a very simple project and show us how it failed?

cbunhok commented 11 years ago

Could I show you my code?

goodwill commented 11 years ago

Can try, but better try to really build a concise code sample to show what's wrong. This process might end up help you to fix the error yourself.

On 16 Aug, 2013, at 7:04 PM, cbunhok notifications@github.com wrote:

Could I show you my code?

— Reply to this email directly or view it on GitHub.

cbunhok commented 11 years ago

Here is my code :

View file:

= simple_form_for @course, validate: true, :html => { :multipart => true, class: "form-course"} do |f| = f.input :category_id, input_html: {id: "category_select2",class: "category-select2", data: {url: school.categories_path()}, value: @course.category_id == nil ? params[:category_id] : @course.category_id, cat_name: "#{@course.category.name unless @course.category == nil}"}


spec file :

context "Create New" do it "successfully", :pending do as_account(account) do visit school.new_course_path(listing_id: listing)

    select2 'Category1', from: 'Category'
    fill_in 'course_title', with: "Ruby on Rails"
    fill_in 'Duration', with: 48
    fill_in 'Cost', with: 12
    fill_in 'course_textbook_ids', with: "Ruby"
    fill_in 'course_objectives_attributes_0_objective', :with => "1.Introduction"
    fill_in 'description', with: "New Course"

    expect {
      within(".set-whitespace") do
        click_button "Save"
      end
    }.to change(School::Course, :count).by(1)
    current_path == school.root_path(listing_id: listing)
    expect(page).to have_content "A new course was created successfully."
  end
end