Behat "Unrecognized options"
Asked Answered
A

2

10

I'm trying to run Behat (first time for me) and it worked.

But i have a configuration problem. I tried to change the paths of features and bootstrap like so:

#behat.yml
default:
    paths:
        features: app/tests/features
        bootstrap: %behat.paths.features%/bootstrap

Now i'm getting an exception:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] Unrecognized options "paths" under "testwork"

What did i do wrong?

Antimagnetic answered 8/1, 2014 at 9:45 Comment(0)
W
24

Behat 3 is out by now. You configure paths as follows:

#behat.yml
default:
  autoload:
    '': %paths.base%/tests/features/bootstrap
  suites:
    default:
      paths:
        - %paths.base%/tests/features

The path given in the autoload section sets the path where Behat looks for context classes. The paths in the suites section are where the feature definitions (of the default suite in this case) live in.

Wendall answered 2/9, 2014 at 15:16 Comment(3)
Current behat documentation is allways pointing to 2.5 [2014-10-06]. So, here is cached version: webcache.googleusercontent.com/…Bobodioulasso
Current Behat documentation does not even mention the "autoload" setting at all. docs.behat.org/en/latest/guides/5.suites.htmlAlfonzoalford
Behat 3 documentation: custom autoloading, suite pathsWendall
C
4

You're trying to use Behat 3, which is not released yet - use version 2.5 instead.

Calhoun answered 8/1, 2014 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.