wrozka/capybara-angular

timeout while waiting for angular

Closed this issue ยท 8 comments

Hello!
I'm trying to create a basic feature spec using capybara / rspec / angular but i'm not able to make my code working.

require 'rails_helper'

feature "Jobs Management", :type => :feature, current: true do
  include Capybara::Angular::DSL

  scenario 'SA creates a new Job' do
    Capybara.current_driver = :webkit

    visit '/#/users/sign_in'
    fill_in 'field-email', with: 'email@email.com'
    fill_in 'field-password', with: 'TestPass'
    click_button 'Sign in'
  end

end

The following spec throws timeout while waiting for angular exception. Am i doing something wrong? Thanks in advance for any clues

My env:
ruby 2
rails 4.1.0
rspec 3

I have also experienced this issue. I'm not sure it is related to this library, as in my case a particular query was going out of the bounds of Capybara's default wait time. I increased Capybara.default_wait_time to account for the extra time needed, and I no longer run into this error.

I've released version 0.1.0 it includes @atermenji fix.

Fix works and resolves a lot of pain points in regards to tests running in a continuous integration setup. Great work @wrozka and @atermenji!

Bug has been reintroduce in 0.1.1 downgrade to 0.1.0 to fixe it.

Yup, bug is back and I even downgrading doesn't fix it for my application.

ryaz commented

Any update on that? I have the same issue in chrome but with poltergeist it works fine.

This help me

/rails_helper.rb
Capybara.configure do |config|
config.default_wait_time = 5
end

A not-so-obvious side note from me that might be relevant to others: these timeouts might have to do more with how the app is performing than Capybara itself. Assuming there's a default_max_wait_time set, if your app continues running (DB queries and whatnot) for longer than that, it will certainly timeout. Check your logs while the specs are running.