Avoid output console.log to STDOUT

1,222 views
Skip to first unread message

Marcelo Giorgi

unread,
May 9, 2012, 8:51:38 PM5/9/12
to capybar...@googlegroups.com
Hi guys,

Perhaps this is a newbie question, but I'm finding a way to disable logging of console.log to STDOUT. I have plenty of logging on my app, and this prohibits me to see the rspec process those are interspersed with the console.log output on STDOUT.

Anyone knows a way to feature ?

Joe Ferris

unread,
May 10, 2012, 9:44:02 AM5/10/12
to capybar...@googlegroups.com
You can do this by initializing the driver with nil for stdout:

    Capybara.register_driver :webkit do |app|
      Capybara::Driver::Webkit.new(app, :stdout => nil)
    end

-Joe

Estevão Mascarenhas

unread,
Jan 16, 2013, 12:22:15 PM1/16/13
to capybar...@googlegroups.com
Hey Joe, 

I'm trying to avoid this output behavior but your code isn't working for me:
It gives me this error:

An error occurred in an after hook
  ArgumentError: wrong number of arguments(2 for 0)

For this line of code:

Capybara::Driver::Webkit.new(app, :stdout => nil)

Something changed?
Thanks in advance!

-Estevao 

Joe Ferris

unread,
Jan 16, 2013, 2:27:20 PM1/16/13
to capybar...@googlegroups.com
Hey Estevao,

In the latest capybara-webkit, the class is now Capybara::Webkit::Driver. Can you give that a shot?

-Joe

Nam Luu

unread,
Jan 30, 2013, 9:29:46 PM1/30/13
to capybar...@googlegroups.com
Hey Joe,

I'm using : 

Capybara::Driver::Webkit.new(app, :stdout => nil)

It didn't show the STDOUT message . But I got new error:

      undefined method `write' for nil:NilClass (NoMethodError)
      features/browsing.feature:4:in `Given I am on the "/" page of CL'

      Unable to find select box "language" (Capybara::ElementNotFound)
      ./features/step_definitions/general_steps.rb:7:in `/^I select "(.*?)" from "(.*?)"$/'

In my step_definitions:
      Given /.../ do |path|
            visit path

      When /.../ do |val|
            select (val)

visit path seems doesn't to work. 
Am I missing something?

-Nam

Matt Horan

unread,
Jan 31, 2013, 8:15:21 AM1/31/13
to capybar...@googlegroups.com
On Wed, Jan 30, 2013 at 06:29:46PM -0800, Nam Luu wrote:
> Capybara::Driver::Webkit.new(app, :stdout => nil)
>
>
> It didn't show the STDOUT message . But I got new error:
>
> undefined method `write' for nil:NilClass (NoMethodError)

Looks like issue #455
(https://github.com/thoughtbot/capybara-webkit/issues/455). It should be
easy to patch that up.

Cheers,

--
Matt Horan ma...@matthoran.com http://matthoran.com/

Matt Horan

unread,
Feb 4, 2013, 7:54:11 PM2/4/13
to capybar...@googlegroups.com
On Thu, Jan 31, 2013 at 08:15:21AM -0500, Matt Horan wrote:
> On Wed, Jan 30, 2013 at 06:29:46PM -0800, Nam Luu wrote:
> > Capybara::Driver::Webkit.new(app, :stdout => nil)
> >
> >
> > It didn't show the STDOUT message . But I got new error:
> >
> > undefined method `write' for nil:NilClass (NoMethodError)
>
> Looks like issue #455
> (https://github.com/thoughtbot/capybara-webkit/issues/455). It should be
> easy to patch that up.

See https://github.com/thoughtbot/capybara-webkit/pull/458 for a fix.
Reply all
Reply to author
Forward
0 new messages