@@ -27,6 +27,10 @@ Behat supports 3 formatters out of the box:
2727
2828* ``junit `` - prints the output to xml files in the standard junit.xml format
2929
30+ * ``json `` - prints the output to a json file in json format.
31+
32+ You can see the schema of this json file in the `Schema `_ definition in GitHub
33+
3034If you don't want to print output to the console, you can tell Behat
3135to print output to a file instead of ``STDOUT `` with the ``--out `` option:
3236
@@ -36,9 +40,11 @@ to print output to a file instead of ``STDOUT`` with the ``--out`` option:
3640
3741 .. note ::
3842
39- Some formatters, like ``junit ``, always require the ``--out `` option to be
43+ Some formatters, like ``junit `` or `` json `` , always require the ``--out `` option to be
4044 specified. The ``junit `` formatter generates ``*.xml `` files for every
41- suite, so it needs a destination directory to put these XML files into.
45+ suite, so it needs a destination directory to put these XML files into. The ``json `` formatter
46+ outputs a single file, so it needs the path of this file (which will be created if it does
47+ not exist)
4248
4349Also, you can specify multiple formats to be used by Behat using multiple --format options:
4450
@@ -130,6 +136,21 @@ The following options are specific to the Progress formatter:
130136* ``shortSummary `` show just a list of failing scenarios at the end of the output. If false, a full summary
131137 (which also includes a list of failing steps) will be printed. Defaults to false
132138
139+ JUnit formatter
140+ ^^^^^^^^^^^^^^^
141+
142+ The following options are specific to the JUnit formatter:
143+
144+ * ``timer `` show time spent in each scenario and feature. Boolean, defaults to true.
145+
146+
147+ JSON formatter
148+ ^^^^^^^^^^^^^^
149+
150+ The following options are specific to the JSON formatter:
151+
152+ * ``timer `` show time spent in each scenario, feature and suite. Boolean, defaults to true.
153+
133154Setting format options
134155^^^^^^^^^^^^^^^^^^^^^^
135156
@@ -179,7 +200,7 @@ You can disable a formatter so that it won't be available by using the ``disable
179200
180201 return (new Config())->withProfile($profile);
181202
182-
203+ .. _ `Schema` : https://github.com/Behat/Behat/blob/master/resources/schema.json
183204
184205
185206
0 commit comments