使用Poltergeist / PhantomJS时,Cucumber测试的大量输出

时间:2015-03-18 16:44:20

标签: cucumber capybara phantomjs poltergeist

使用Poltergeist运行我的黄瓜测试时,我看到很多输出。我的env.rb中有大多数选项设置为false但我仍然继续看东西。关于如何关闭这个额外的日志记录的任何想法?

以下是我看到的输出。

MIXPANEL REQUEST:
[object Object]
MIXPANEL NOTIFICATION CHECK
MIXPANEL PEOPLE REQUEST:
[object Object]
MIXPANEL PEOPLE REQUEST:
[object Object]
MIXPANEL REQUEST:========================== 99 ==================================> |  ETA: 00:00:03
[object Object]
MIXPANEL NOTIFICATION CHECK
MIXPANEL PEOPLE REQUEST:
[object Object]
 674/674 |================================= 100 ==================================>| Time: 00:11:44

84 scenarios (84 passed)
674 steps (674 passed)
11m44.357s

我的env.rb文件

Capybara.register_driver :poltergeist do |app|
    options = {
        :js_errors => false,
        :phantomjs_logger => false,
        :timeout => 120,
        :debug => false,
        :phantomjs_options => ['--load-images=no', '--disk-cache=false'],
        :inspector => false,
    }
    Capybara::Poltergeist::Driver.new(app, options)

其他信息

  • capybara(2.1.0)
  • 黄瓜(1.3.15)
  • poltergeist(1.6.0)
  • PhantomJS = 2.0.0

1 个答案:

答案 0 :(得分:0)

:phantomjs_logger是记录输出的地方。尝试指定日志文件,默认为STDOUT,例如

:phantomjs_logger => File.open("log/test_phantomjs.log", "a")