I'm trying to use both the html and progress formatter. In version 2.5 this was possible by executing Behat with following options;
./bin/behat -f 'progress,html'
In Behat 3, when I try to pass multiple values for the format option, Behat throws a FormatterNotFoundException. This is the full error message;
[Behat\Testwork\Output\Exception\FormatterNotFoundException]
`pretty,html` formatter is not found or has not been properly registered. Registered formatters: `pretty`, `progress`, `html`.
Note: I'm using the emuse/behat-html-formatter library in order to have the html format available.
Here is a list of options I tried;
./bin/behat -f 'html,pretty'./bin/behat --format 'html,pretty'./bin/behat -f 'pretty,html'./bin/behat --format 'pretty,html'./bin/behat -f html,pretty./bin/behat --format html,pretty./bin/behat -f 'html pretty'./bin/behat --format 'html pretty'Edit: The yml configuration does accept multiple formatters. The issue is only related to the Behat CLI tool;
# behat.yml
default:
formatters:
pretty: true
html:
output_path: /www/behat/reports/
Hi @legovaer
Please try bin/behat -f pretty -f html
I faced similar issue recently and that helped me.
I'll only add you can add multiple --out options too:
./bin/behat --format pretty --out std --format junit --out build
That works indeed.
Not sure wether I should close this issue or not, the (expected) default behavior is not working. Unless the new default behavior is like what has been described above. In that case the documentation needs to be updated.
@legovaer make sure you're reading Behat3 docs, and not Behat2. Part of the problem is that Behat2 docs are shown by default on behat.org (ping @everzet).
Behaviour described above is indeed the expected one. You can close this issue.
If you feel like there's something missing in the docs, please open an issue (or a PR) in the docs repo.
@jakzal I'm quite sure that it's not in the Behat3 docs. Behat3.0 Running Tests is an empty page.
Thanks for the link to the docs repo. I'll start contributing to the docs.
Ticket closed because this is expected behaviour in Behat 3.0 as mentioned by @jakzal.
Most helpful comment
I'll only add you can add multiple
--outoptions too: