3

I'm getting this error on a dozen or so failing specs. Other devs on my team (and our CI) aren't seeing these failing specs so it's a problem local to my kit.

Edit: first 6 lines are an excerpt from capybara-webkit's :webkit_debug driver:

...
Started request to "https://dialog.filepicker.io/dialog/comm_iframe/"
Started request to "https://www.filepicker.io/dialog/comm_iframe/"
Received "Evaluate((typeof angular !== 'undefined') && angular.element(document.querySelector('[ng-app]')).length > 0)"
"TimeoutCommand" waiting for load to finish
Received 0 from "https://dialog.filepicker.io/dialog/comm_iframe/"
Page finished with false
...

  1) User edits profile information
     Failure/Error: click_on t('users.edit')
     Capybara::Webkit::InvalidResponseError:
       Unable to load URL: http://127.0.0.1:53899/myprofile?as=1089 because of error loading https://dialog.filepicker.io/dialog/comm_iframe/: Unknown error
     # ./spec/features/users_spec.rb:30:in `block (2 levels) in <top (required)>'
     # ./spec/support/background_jobs.rb:14:in `block (3 levels) in <top (required)>'
     # ./spec/support/background_jobs.rb:5:in `run_background_jobs_immediately'
     # ./spec/support/background_jobs.rb:13:in `block (2 levels) in <top (required)>'

How can I troubleshoot this? Is this somehow AngularJS related?!?

Edit2: error is thrown on visit path (see below). Adding save_and_open_page one line before just opens an empty page. Putting anything after line 30 never gets called because of error. Adding binding.pry on 29 gets me to console but I'm not really sure what I should be looking for to troubleshoot this.

     25:   scenario 'edits profile information', js: true do
     26:     new_avatar = 'http://example.com/avatar.png'
     27:     user = create(:user)
     28:
  => 29:     binding.pry
     30:     visit myprofile_path(as: user)
     31:     click_on t('users.edit')
     32:     edit_profile(name: 'Edit User', avatar: new_avatar)
     33:     visit myprofile_path
     34:
     35:     expect(page).to have_text('Edit User')
Meltemi
  • 37,979
  • 50
  • 195
  • 293
  • add a save_and_open_page before the error and see if you are on the right page with the right elements. – forthowin Apr 09 '15 at 00:45
  • `save_and_open_page` doesn't appear to do anything… – Meltemi Apr 09 '15 at 01:03
  • add gem 'launchy' in your gemfile and try again – forthowin Apr 09 '15 at 01:13
  • add gem 'pry' in your gemfile, add a binding.pry before the error, run the test, in the console type in save_and_open_age, what does it say? – forthowin Apr 09 '15 at 01:22
  • ok, see edit2 above. – Meltemi Apr 09 '15 at 17:25
  • post information about myprofile_path like the method or the route – forthowin Apr 09 '15 at 17:39
  • maybe it should just be visit myprofile_path(user) – forthowin Apr 09 '15 at 17:41
  • `myprofile GET /myprofile(.:format)` routes to `users#show`. Thing is these specs pass on my laptop, other dev's boxes *and* on our CI server. I just can't figure out why this is failing only on my main dev box. Driving me nuts! Appreciate your help though… – Meltemi Apr 09 '15 at 18:15
  • I am seeing the same issue on my project. Also as in your case, it is not affecting some people on my team or our CI server (but at least a couple of my teammates are getting the error). Also, I think I started seeing it on the same day as you, April 9th 2015. A day earlier, Apple pushed out an OS X Update to Yosemite version 10.10.3 ( https://support.apple.com/kb/DL1804?locale=en_US ) and I installed the update. Some of my teammates did too, but not all. Our CI server is semaphore and I'm pretty sure that's not running OS X. So far the ones who have the error also updated to 10.10.3. – Charlie Apr 13 '15 at 22:57
  • I am not certain whether the new OS X version actually caused the error, or how it might have done so (one teammate commented that some OpenSSL-related things had changed or broken, so maybe related to that?), or how the error can be fixed, but I'd love to know what others find out as this is still causing failing specs on my project. – Charlie Apr 13 '15 at 23:03
  • I'll keep monitoring this in hopes of a better answer. Until then tests pass on Semaphore but will fail locally unless I blacklist some Filepicker URLs (see my 'answer' below). – Meltemi Apr 16 '15 at 18:54
  • Having this problem too--blocking requests is not an option (since that's what we're testing) – FreePender Jun 24 '15 at 18:17

1 Answers1

3

Ended up blocking those requests altogether spec_helper.rb:

  config.before :each, js: true do
    page.driver.browser.url_blacklist = [
      "https://dialog.filepicker.io",
      "https://www.filepicker.io"
    ]
  end
Meltemi
  • 37,979
  • 50
  • 195
  • 293