thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 427 forks source link

I still get WebkitNoResponseError #181

Closed tmaier closed 11 years ago

tmaier commented 13 years ago

This is a followup of #68. Also after upgrade of capybara-webkit (0.7.1) and capybara (1.1.1) the specs still fail when running more than one spec with js: true.

rspec spec/requests/delivery_notes_spec.rb spec/requests/organizations_spec.rb spec/requests/people_spec.rb spec/requests/projects_spec.rb spec/requests/schedules_spec.rb spec/requests/work_breakdown_structures_spec.rb
Run filtered including {:focus=>true}

DeliveryNotes
  GET /projects/12345/work_breakdown_structures/12345/destroy
 >> Visit
 >> 1
 >> 36
 >> http://127.0.0.1:62396/users/sign_in
 << ok
 << 0
 << 
 >> Find
 >> 1
 >> 489
 >> .//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'Email' or ./@name = 'Email') or ./@id = //label[normalize-space(string(.)) = 'Email']/@for)] | .//label[normalize-space(string(.)) = 'Email']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]
 << ok
 << 1
 << 1
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 7
 >> visible
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 3
 >> set
 >> 1
 >> 1
 >> 19
 >> email-0@example.com
 << ok
 << 0
 << 
 >> Find
 >> 1
 >> 501
 >> .//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')][((./@id = 'Password' or ./@name = 'Password') or ./@id = //label[normalize-space(string(.)) = 'Password']/@for)] | .//label[normalize-space(string(.)) = 'Password']//.//*[self::input | self::textarea][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'radio' or ./@type = 'checkbox' or ./@type = 'hidden' or ./@type = 'file')]
 << ok
 << 1
 << 2
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 2
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 7
 >> visible
 >> 1
 >> 2
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 2
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 3
 >> set
 >> 1
 >> 2
 >> 7
 >> Geheim!
 << ok
 << 0
 << 
 >> Find
 >> 1
 >> 369
 >> .//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][((./@id = 'Sign in' or ./@value = 'Sign in') or ./@title = 'Sign in')] | .//input[./@type = 'image'][./@alt = 'Sign in'] | .//button[(((./@id = 'Sign in' or ./@value = 'Sign in') or normalize-space(string(.)) = 'Sign in') or ./@title = 'Sign in')] | .//input[./@type = 'image'][./@alt = 'Sign in']
 << ok
 << 1
 << 3
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 3
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 7
 >> visible
 >> 1
 >> 3
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 3
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 5
 >> click
 >> 1
 >> 3
 << ok
 << 0
 << 
 >> Visit
 >> 1
 >> 71
 >> http://127.0.0.1:62396/projects/4e8ab5513e81a7640e000007/delivery_notes
 << ok
 << 0
 << 
 >> Find
 >> 1
 >> 21
 >> .//*[@id = 'content']
 << ok
 << 1
 << 1
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 7
 >> visible
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 10
 >> findWithin
 >> 1
 >> 1
 >> 201
 >> .//a[./@href = '/projects/4e8ab5513e81a7640e000007/delivery_notes/4e8ab5513e81a7640e00000c'][(((./@id = 'Show' or normalize-space(string(.)) = 'Show') or ./@title = 'Show') or .//img[./@alt = 'Show'])]
 << ok
 << 1
 << 2
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 10
 >> findWithin
 >> 1
 >> 1
 >> 228
 >> .//a[./@href = '/projects/4e8ab5513e81a7640e000007/delivery_notes/4e8ab5513e81a7640e00000c'][(((./@id = 'Show' or contains(normalize-space(string(.)), 'Show')) or contains(./@title, 'Show')) or .//img[contains(./@alt, 'Show')])]
 << ok
 << 1
 << 3
 >> Evaluate
 >> 1
 >> 49
 >> window.original_confirm_function = window.confirm
 << ok
 << 2
 << {}
 >> Evaluate
 >> 1
 >> 47
 >> window.confirm = function(msg) { return true; }
 << ok
 << 2
 << {}
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 10
 >> findWithin
 >> 1
 >> 1
 >> 134
 >> .//a[./@href][(((./@id = 'Destroy' or normalize-space(string(.)) = 'Destroy') or ./@title = 'Destroy') or .//img[./@alt = 'Destroy'])]
 << ok
 << 1
 << 4
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 4
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 7
 >> visible
 >> 1
 >> 4
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 4
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 5
 >> click
 >> 1
 >> 4
 << ok
 << 0
 << 
 >> Evaluate
 >> 1
 >> 49
 >> window.confirm = window.original_confirm_function
 << ok
 << 4
 << null
 >> Find
 >> 1
 >> 21
 >> .//*[@id = 'content']
 << ok
 << 1
 << 1
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 7
 >> visible
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 10
 >> findWithin
 >> 1
 >> 1
 >> 98
 >> ./descendant-or-self::*[contains(normalize-space(.), 'Delivery note was successfully destroyed.')]
 << ok
 << 3
 << 2,3
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 10
 >> findWithin
 >> 1
 >> 1
 >> 201
 >> .//a[./@href = '/projects/4e8ab5513e81a7640e000007/delivery_notes/4e8ab5513e81a7640e00000c'][(((./@id = 'Show' or normalize-space(string(.)) = 'Show') or ./@title = 'Show') or .//img[./@alt = 'Show'])]
 << ok
 << 0
 << 
 >> Node
 >> 2
 >> 10
 >> isAttached
 >> 1
 >> 1
 << ok
 << 4
 << true
 >> Node
 >> 3
 >> 10
 >> findWithin
 >> 1
 >> 1
 >> 228
 >> .//a[./@href = '/projects/4e8ab5513e81a7640e000007/delivery_notes/4e8ab5513e81a7640e00000c'][(((./@id = 'Show' or contains(normalize-space(string(.)), 'Show')) or contains(./@title, 'Show')) or .//img[contains(./@alt, 'Show')])]
 << ok
 << 0
 << 
 >> Reset
 >> 0
 << ok
 << 0
 << 
    destroy delivery note

Projects
  POST /projects/12345/destroy
 >> Visit
 >> 1
 >> 36
 >> http://127.0.0.1:62396/users/sign_in
 << 
 >> Reset
 >> 0
    destroy (FAILED - 1)

Failures:

  1) Projects POST /projects/12345/destroy destroy
     Failure/Error: login_as user
     Capybara::Driver::Webkit::WebkitNoResponseError:
       No response received from the server.
     # ./spec/support/auth_methods.rb:14:in `login_as'
     # ./spec/requests/projects_spec.rb:7:in `block (2 levels) in <top (required)>'

Finished in 19.31 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/requests/projects_spec.rb:169 # Projects POST /projects/12345/destroy destroy

This is the code of the specs:

  describe "POST /projects/12345/destroy" do
    it "destroy", js: true, focus: true do
      own_p1 = Fabricate(:project, :name => "Mein Projekt 1", :owner => user.organization)

      visit projects_path

      within("#content") do
        page.should have_content "Mein Projekt 1"

        handle_js_confirm do
          click_link "Destroy"
        end
      end

      within("#content") do
        page.should have_content "Project was successfully destroyed."
        page.should_not have_content "Mein Projekt 1"
      end
    end
  end
  describe "GET /projects/12345/work_breakdown_structures/12345/destroy" do
    let!(:delivery_note) {Fabricate(:delivery_note, project: project)}

    it "destroy delivery note", js: true, focus: true do
      visit project_delivery_notes_path(project)

      within("#content") do
        page.should have_link "Show", href: project_delivery_note_path(project, delivery_note)

        handle_js_confirm do
          click_link "Destroy"
        end
      end

      within("#content") do
        page.should have_content "Delivery note was successfully destroyed."

        page.should_not have_link "Show", href: project_delivery_note_path(project, delivery_note)
      end
    end
  end
# Confirms an JavaScript Alert box
# Source: https://github.com/thoughtbot/capybara-webkit/issues/84
def handle_js_confirm(accept=true)
  page.evaluate_script "window.original_confirm_function = window.confirm"
  page.evaluate_script "window.confirm = function(msg) { return #{!!accept}; }"
  yield
ensure
  page.evaluate_script "window.confirm = window.original_confirm_function"
end
groman-me commented 12 years ago

I've had the same problem. The solution for me was put the visit call at first line inside of it block (before Factory calls). For example it could be something like that:

describe "POST /projects/12345/destroy" do
  it "destroy", js: true, focus: true do        
    visit index_path
    own_p1 = Fabricate(:project, :name => "Mein Projekt 1", :owner => user.organization)
    visit projects_path
mattscilipoti commented 12 years ago

Temporary workaround: we found that removing rails_footnotes fixed this error for us. We haven't found what it was about the footnotes that caused an issue.

simonoff commented 12 years ago

Any updates?

Ken-Richard commented 12 years ago

I am getting similar errors when running on my CI server (ubuntu/jenkins) with both xvfb-run and headless. The test work fine running on my OSX development machine. The tests run for a little while and then I get the error. Once the error appears the rest of the tests fail.

Any work arounds or debugging recommendations?

vidriloco commented 12 years ago

Here also having the same problems: "No response received from the server" followed by "Broken pipe" error.

Using capybara-webkit 0.7.2

flynfish commented 12 years ago

+1 same issue but on capybara-webkit 0.12.1 and capybara 1.1.2

andruby commented 12 years ago

+1 I also get a "No response received from the server" followed by "Broken pipe" errors for all remaining specs. Using capybara-webkit 0.12.1 and capybara 1.1.2 (tried WEBrick and Unicorn as test server)

flynfish commented 12 years ago

I have tried QT versions 4.8.0, 4.8.1 and 4.8.2 to no avail. A coworker is on QT 4.7.4 and does not get these errors. I tried switching versions to 4.7.4 with brew, but that bottle is no longer hosted. I then tried to install that version through brew with the --build_from_source option but I get a build error.

andruby commented 12 years ago

@flynfish, @vidriloco do you use twitter-bootstrap-rails? Or any other less css gem? My acceptance specs used to run fine until I moved from a sass version of twitter bootstrap to the less version (twitter-bootstrap-rails).

It might have something to do with this bug or it might be a coincidence..

flynfish commented 12 years ago

@andruby I am indeed using less-rails-bootstrap. Were you able to fix the issue?

On a sidenote related to my previous comment, I got QT 4.7.4 installed and my tests are still failing with the same no response from server and broken pipe errors. Not sure why it worked on my coworkers environment.

andruby commented 12 years ago

@flynfish I've not tried many solutions yet. Maybe precompiling assets in test environment might work around the bug? Please let me know when you find a fix.

apangeajwrubel commented 12 years ago

Having the same issue - none of the other engineers are seeing this. Feels like it might be a version issue. I'm on capybara 1.1.2 and capybara-webkit 0.12.1, but all of the rest of the engineers use the same versions. I'm on qt 4.8.2.

flynfish commented 12 years ago

So I think we found the root cause, it has to do with font rendering. Not sure if everyone having the issue is running bootstrap, but if we comment out our @import of the font.less file, then the errors go away.

apangeajwrubel commented 12 years ago

Hmm - we aren't using bootstrap but we are using zurb foundation. Let me see if there are any fonts being included in our project that might be the cause....

mkrisher commented 12 years ago

what @flynfish and I found was some console output from capybara-webkit complaining about web font rendering. Bootstrap or not, any web font rendering can randomly cause a font render exception to be thrown in webkit in various version of Qt in our experience.

apangeajwrubel commented 12 years ago

The only reference to @font in our project is in modernizr - but we do have a javascript library that loads assets from a remote server. I bet the core issue is actually any call to a remote server... Hmmm.. off to do some testing.

mkrisher commented 12 years ago

Below is the error I'm seeing:

webkit_server[86928] : ATSFontGetFileReference failed: error -50.

apangeajwrubel commented 12 years ago

@mkrisher how are you getting to that log? It's not in the rails stack trace... is webkit generating a separate log?

mkrisher commented 12 years ago

@apangeajwrubel yes, I'm seeing it in the console. Likewise console output gets rendered when say running RSpec in the terminal.

flynfish commented 12 years ago

ok, this is really weird. Apparently when I commented out that import, webkit decided not to throw any errors. After running it again I got the errors again. :rage1:

apangeajwrubel commented 12 years ago

Ah - that's it. We're not using RSpec. Output must be different. Still looking in to the cause but we're fairly confident it's related to remote asset loading, which would explain the problem happening with web fonts and external js includes.

mutewinter commented 12 years ago

I started getting this error today. I happened after running a bundle update. I reverted the updates one by one and tracked it down to the gem twitter-boostrap-rails (2.1.0). The update had brought me from 2.0.7 to 2.1.0.

Reverting to 2.0.7 fixes this problem entirely for me. I'm going to snoop around in twitter-boostrap-rails and see what might be the culprit.

I'm using

gem 'twitter-bootstrap-rails', '= 2.0.7'

to specify the gem since version 2.0.9 also breaks capybara-webkit.

Update: I specified 2.0.8 and it doesn't break. The error is somewhere between 2.0.8 and 2.0.9

apangeajwrubel commented 12 years ago

Still debugging this on our end since we don't use twitter bootstrap. I happened to have activity monitor up and noticed a very brief flash of fontd soaking CPU when I started up my test suite. I figure it might be a useful data point since others have seen commenting out web font imports solve the problem.

mutewinter commented 12 years ago

My guess is that there's some sort of timeout threshold that's being hit. Perhaps if the assets take too long to compile this happens.

apangeajwrubel commented 12 years ago

Gotta be longer than 60 seconds then - that's as high as I set the default wait time and it didn't seem to change the outcomes.

mutewinter commented 12 years ago

@apangeajwrubel I tried that too. I was so sure that was going to fix it. The hunt continues.

apangeajwrubel commented 12 years ago

Do any of you know how to install this gem against a specific version of qt? Thought maybe this was a 4.8.x issue so I grabbed 4.7.4 - this article (https://engineering.purdue.edu/elab/wiki/index.php/Torch_7_Installation_on_Mac_OS_X) indicated 4.8.X might have issues. But there's no bottle for the 4.7.x line of qt anymore so I had to install from the .dmg, and now I can't figure out how capybara-webkit is linking to qt when it installs.

dhiemstra commented 12 years ago

twitter-bootstrap-rails 2.0.9 introduces font-awesome support. According to this thread it has something to do with Qt not being able to handle a font on your system. I suspect Qt can't handle font-awesome.

rschmukler commented 12 years ago

I can confirm that I am having this bug on a non twitter-bootstrap-rails project which independently uses font-awesome

edit: A temp hack fix for me was:

Switch application.css to application.scss.erb and then manually import font-awesome only if Rails.env.test? is false.

ie: <% unless Rails.env.test? %> @import "font-awesome" <% end %>

dhiemstra commented 12 years ago

@rschmukler thanks, this also works when using twitter-bootstrap-rails >= 2.0.9 that has font-awesome included.

msolli commented 12 years ago

I use the font-awesome-sass-rails gem and ran into this issue.

While @rschmukler's solution works, I didn't want to change application.css to use ERB. I came up with the following workaround:

First, remove the asset path that the gem inserts by creating an initializer:

# config/initializers/font_awesome.rb

if Rails.env.test?
  Rails.application.config.assets.paths.reject! do |path|
    path =~ /font-awesome/
  end
end

(You can find out which paths Rails are using by running Rails.application.config.assets.paths in the Rails console.)

Then create an empty placeholder file called font-awesome.sass and place it under spec/support/assets/stylesheets:

// spec/support/assets/stylesheets/font-awesome.sass

// Empty placeholder

Finally include spec/support/assets in the Rails assets load path in spec_helper.rb:

# spec/spec_helper.rb

# … other stuff …
Rails.application.config.assets.paths << "spec/support/assets"

Now, when you @import "font-awesome" in application.css (or any other place), your specs will use the empty one.

You could instead apply this to the whole test environment, not just rspec, by adding the spec/support/assets path in config/environments/test.rb:

# config/environments/test.rb

config.assets.paths << "spec/support/assets"
patricklewis commented 12 years ago

@msolli Thanks! I followed your steps and was able to quickly fix my capybara-webkit errors with the font-awesome-sass-rails gem installed.

gravis commented 12 years ago

@msolli : Thanks, you saved my day. Btw, for me the initializer has to be using:

path =~ /fonts/
kennym commented 12 years ago

@rschmukler thanks, dude! That worked.

netikular commented 12 years ago

+10 @moslli since this solution works awesome! +1 @gravis for suggesting using /fonts/

jesseclark commented 12 years ago

Everything was working fine if I was changing the driver to webkit in the setup of my tests but when I made webkit the default_driver in test_helper.rb I started seeing segfaults in reset_sessions! in my teardown method.

I am using bootstrap with font-awesome enabled.

@msolli 's solution worked for me ( modified for test:unit of course ) but I also had to set path =~ fonts as @gravis mentioned.

mhoran commented 12 years ago

Please check out the latest master and let us know if these issues have gone away.

carloslopes commented 12 years ago

@mhoran i put this in my Gemfile (referencing the latest commit on master at the time of this comment):

  gem 'capybara-webkit', git: 'git://github.com/thoughtbot/capybara-webkit.git', ref: '67b8a3391'

And it didn't solve my problem.. i keep receiving No response from the server error from the firs example and the consequent examples throw Broken pipe errors

Can anyone confirm this too?

I'm on a Mac OS X 10.8.2 with Qt version 4.8.3 and capybara version 1.1.2

jferris commented 12 years ago

@carloslopes can you run using the :webkit_debug driver and paste the output? That may tell us which command it's running during the crash.

carloslopes commented 12 years ago

Sure. Here is the output: https://gist.github.com/3959987

jferris commented 12 years ago

@carloslopes from the backtraces there, it looks like it's running the released version of capybara-webkit (0.12.1) and not the ref you mentioned. Did you remember to run bundle install and bundle exec? Also, there have been a couple new fixes on master since that ref, so you may want to use master instead.

carloslopes commented 12 years ago

@jferris sorry for the last gist, i forgot that i reverted my gemfile to use the version 0.12.1 so i could make the tests pass on my another machine with linux.

here is the new output: https://gist.github.com/3959987

jferris commented 12 years ago

@carloslopes great - thanks. I think that will help us narrow down where the segfault may be occurring.

carloslopes commented 12 years ago

@jferris great!

if i can help with something else, just ask me :smile:

jamilbk commented 11 years ago

+1

Seems to be a QtWebKit issue with certain web fonts with on OS X. Possibly this one? https://bugs.webkit.org/show_bug.cgi?id=61031

jesseclark commented 11 years ago

Using OS X 10.6.8, Qt 4.7 Using capybara (2.0.1) Using capybara-webkit (0.13.0) from git://github.com/thoughtbot/capybara-webkit.git (at master) with native extensions

I get this exception when running my integration tests:

          Broken pipe
        @ /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/bundler/gems/capybara-webkit-2eb38b3c0235/lib/capybara/webkit/connection.rb:21:in `write'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/bundler/gems/capybara-webkit-2eb38b3c0235/lib/capybara/webkit/connection.rb:21:in `puts'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/bundler/gems/capybara-webkit-2eb38b3c0235/lib/capybara/webkit/connection.rb:21:in `puts'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/bundler/gems/capybara-webkit-2eb38b3c0235/lib/capybara/webkit/browser.rb:140:in `command'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/bundler/gems/capybara-webkit-2eb38b3c0235/lib/capybara/webkit/browser.rb:30:in `reset!'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/bundler/gems/capybara-webkit-2eb38b3c0235/lib/capybara/webkit/driver.rb:145:in `reset!'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/gems/capybara-2.0.1/lib/capybara/session.rb:72:in `reset!'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/gems/capybara-2.0.1/lib/capybara.rb:261:in `block in reset_sessions!'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/gems/capybara-2.0.1/lib/capybara.rb:261:in `each'
          /Users/jesse/.rvm/gems/ruby-1.9.3-p327@corengi.com/gems/capybara-2.0.1/lib/capybara.rb:261:in `reset_sessions!'
          test/test_helper.rb:76:in `reset_capybara'

Not importing font-awesome fixes the issue (btw - I am using font-awesome via the compass_twitter_bootstrap gem ).

dsci commented 11 years ago

I second @jesseclark 's comment.

Using OS X 10.7.5, Qt 4.8.2, Capybara 1.1.4, capybara-webkit 0.13.0, removing font-awesome fixes the issue.

panozzaj commented 11 years ago

For another potential workaround, check out the gists at https://github.com/jonleighton/poltergeist/issues/44. I was able to use one like:

if Rails.env.test?
  require 'rack/contrib/simple_endpoint'
  Rails.application.config.middleware.insert_after Rack::Runtime, Rack::SimpleEndpoint, /\.ttf$/ do |req, res, match|
    res.status = '403'
    "I will not serve TTF fonts in test mode."
  end
end

(after installing the rack-contrib gem)

mhoran commented 11 years ago

Could folks give #442 a shot? I've implemented a workaround that resolves these crashes with Font Awesome.

Govinda-Fichtner commented 11 years ago

I am also having this issue with fonts from http://fontello.com/. So this seems not a problem of font-awesome. According to http://code.google.com/p/wkhtmltopdf/issues/detail?id=410 and there comment 11 it seems to be related to qt 4.x... I could not get it working with qt 4.8.4 and latest capybara-webkit master... I also found this http://trac.webkit.org/changeset/113968, but cannot say if it will remove the problems with custom fonts. Will we see support for QT5 in the near future?