3

The Behat command line configuration options support the definition of multiple formatters: http://docs.behat.org/guides/6.cli.html#format-options.

I want to define multiple formatters in a YAML configuration file instead, but I suck at YAML and don't seem able to get the syntax correct.

So far I have:

default:
  - formatter:
      name: junit
      parameters: 
        output_path: xml
  - formatter:  
      name: pretty
      parameters: ~

  extensions:
    Behat\MinkExtension\Extension:
      base_url:  'http://myurl.com'
      javascript_session: sahi
      browser_name: chrome
      goutte: ~
      sahi: ~

Which gives the error:

You cannot define a mapping item when in a sequence

I've also tried this defining the elements as a list within a single formatter, but says that the formatter cannot contain numbered indexes.

4

1 に答える 1

5

Behat 3.x では次を使用します。

build:
  formatters:
    progress:
    junit: [./build/logs/behat]
    html: [./build/behat/index.html]

Behat 2.x では、コマンド ラインと同様にカンマを使用してフォーマッタ名を区切ります。

default:
  formatter:
    name: progress,junit,html
    parameters:
      output_path: ,./build/logs/behat,./build/behat/index.html
于 2012-12-04T11:57:52.893 に答える