sharan
sharan

Reputation: 213

Symfony\Component\Yaml\Exception\ParseException thrown for behat.yml

My behat.yml looks like this:

 default:
  firefox:
   context:
       parameters:
            Browser_Name: firefox
   extensions:
            Behat\MinkExtension\Extension:            
            base_url: https://google.com
            javascript_session: selenium2
            browser_name: firefox
            goutte: ~
            selenium2: ~

I'm getting this exception:

   [Symfony\Component\Yaml\Exception\ParseException]  Indentation problem in "D:\\mypgms\\behat.yml" at line 7 (near " extensions:").

How can I resolve this issue?

Upvotes: 0

Views: 2896

Answers (1)

Nicolai Fröhlich
Nicolai Fröhlich

Reputation: 52493

The indentation of your YAML file is inconsistent.

Please see the YAML spec's chapter indentation spaces.

Either use 2 or 4 spaces indentation consistently across your YAML config file to resolve the issue.

example with 2-space indentation:

default:
  extensions:
    Behat\MinkExtension\Extension:            
      base_url: "https://base-url.com"
      # ...
  context:
    parameters:
      class:    Your\Custom\Context
      base_url: "https://context-base-url.com"
      # ...

Upvotes: 4

Related Questions