Unrecognized options "suites" under "behat"

Potney Switters

I am using behat 2.4(stable), and I am trying to pass parameters into class's, that extends BehatContext class, constructor. However I get 'Unrecognized options "suites" under "behat"', with the following set up.

I am using the following behat.yml file:

default:
  suites:
    default:
      contexts:
        exampleContext:
          browser: http://localhost:8080
          browser_version: /var/tmp
  paths:
    features: %behat.paths.base%/../../
    bootstrap: %behat.paths.base%/../../
  extensions:   
    Behat\MinkExtension\Extension:
       # base_url is the URL to your dev site. Make sure you include
       # the port at the end. e.g.
       base_url: http://example.web01.com
       default_session: selenium2
       browser_name: 'chrome'
       selenium2:                    
         capabilities: { "browser": "firefox", "version": "14"}
       sites/all/libraries/extensions/DrupalBehatExtension.php: ~
  filters:
    # The default profile does not rebuild from nothing so do not run tests
    # that require a rebuild from nothing.
    tags: ~@require-rebuild
  context:
    class: DrupalContext
    parameters:
      # If you'd like to test on a clone of the actual site data set to true.
      use_test_database: false
      # If an existing test database exists then it will be used unless reset_database is set to true.
      reset_database: false
      # If you would like to clear the db and run site install on every feature
      # set to the name of an install profile, otherwise set to false.
      # If you do set this you should also set use_test_database to true.
      rebuild_on_feature: false
      # If you would like to enable a module after running site install
      rebuild_module: false
      # Set the name of the site folder to use for settings.php.
      site: dev.example.com

My class implementation is

class exampleContext extends BehatContext {


public function __construct($browser = 'ie', $browser_version = '8') {
  ...
}

How can I achieve this? The only answer I've found is the one that demands to take out the DrupalContext which is rather important.

How can i get the Parameters from Behat.yml to a php file?

BentCoder

Try this. This is for Behat 2 not 3 though!

mySymfonyProject/composer.json:

"require": {
    "behat/behat": "2.5.*@stable",
    "behat/behat-bundle": "1.0.0",
    "behat/symfony2-extension": "1.1.2",
    "behat/mink": "1.5.0",
    "behat/mink-extension": "~1.3",
    "behat/mink-selenium2-driver": "1.1.1",
    "behat/mink-goutte-driver": "1.0.9"
},
"config": {
    "bin-dir": "bin"
},
"minimum-stability": "dev",

behat.yml

default:
    context:
        class: FeatureContext
        parameters:
            browser: 'ie'
            browser_version: '8'
    extensions:
        Behat\Symfony2Extension\Extension:
            mink_driver: true
            kernel:
                env: test
                debug: true
        Behat\MinkExtension\Extension:
            base_url: 'http://mysymfonyproject.local/app_test.php/'
            javascript_session: selenium2
            browser_name: firefox
            goutte: ~
            selenium2: ~
    paths:
        features: %behat.paths.base%/src
        bootstrap: %behat.paths.features%/Context

CONTEXT FEATURE

mySymfonyProject/src/Site/CommonBundle/Features/Context/FeatureContext.php

<?php

namespace Site\CommonBundle\Features\Context;

use Behat\MinkExtension\Context\MinkContext;

class FeatureContext extends MinkContext
{
    public function __construct($browser, $browser_version)
    {
        // Do whatever you wish with params
    }

    //And your own methods
}

TESTS

When you have feature files you can run them like this (this runs all in one go. for more info read behat doc):

bin/behat @SiteCommonBundle

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Behat "Unrecognized options"

From Dev

Separating test suites in Behat

From Dev

Unrecognized options "scheme, cluster, url" under "lopi_pusher"

From Dev

Define multiple tags and remove suites in behat.yml

From Dev

Unrecognized options "csrf_provider" under "security.firewalls.form_login"

From Dev

Unrecognized options swift_mailer under sonata_notification.consumers error

From Dev

Symfony security.yml Unrecognized options "check_path, login_path, provider" under "security.firewalls.secured_area.ldapsecure"

From Dev

Doctrine cache unrecognized options error

From Dev

Running behat test under different browsers

From Dev

FOS\RestBundle, "Unrecognized options" on Symfony2

From Dev

Cassandra CQLSH Unrecognized COPY FROM options: maxinserterrors

From Dev

How can options be parsed in a Bash script, leaving unrecognized options after the "--"?

From Dev

OpenVPN - Options error: Unrecognized option or missing or extra parameter(s) (2.4.5)

From Dev

Symfony 3 - Ckeditor bundle : Unrecognized options "template, template_parameters"

From Dev

Unrecognized option "firewall_name" under "hwi_oauth"

From Dev

Visual Studio 2013 - Debug options missing under configuration options

From Dev

parsing all options under select in BeautifulSoup

From Dev

options under dropdown menu is not getting selected

From Dev

"%1" Application under Change options in Properties window

From Dev

Tiny MCE - Restrict the options under "format"

From Dev

Java XX command line options unrecognized (e.g: -XX:+UseStringDeduplication, -XX:MaxGCPauseMillis)

From Java

Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`... Did you mean to put these under `headers`?

From Dev

Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

From Dev

Symfony2 : Unrecognized option "admin" under "security.providers.in_memory.memory"

From Dev

sylius: after doing composer update on sylius 0.16 i get 'Unrecognized option "classes" under "sylius_product"

From Dev

Unrecognized option "csrf_token_generator" under "security.firewalls.main.form_login"

From Dev

NSString under ARC may cause -[__NSArrayM length]: unrecognized selector sent to instance?

From Dev

Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

From Dev

Boost.Program_options not linking correctly under Clang

Related Related

  1. 1

    Behat "Unrecognized options"

  2. 2

    Separating test suites in Behat

  3. 3

    Unrecognized options "scheme, cluster, url" under "lopi_pusher"

  4. 4

    Define multiple tags and remove suites in behat.yml

  5. 5

    Unrecognized options "csrf_provider" under "security.firewalls.form_login"

  6. 6

    Unrecognized options swift_mailer under sonata_notification.consumers error

  7. 7

    Symfony security.yml Unrecognized options "check_path, login_path, provider" under "security.firewalls.secured_area.ldapsecure"

  8. 8

    Doctrine cache unrecognized options error

  9. 9

    Running behat test under different browsers

  10. 10

    FOS\RestBundle, "Unrecognized options" on Symfony2

  11. 11

    Cassandra CQLSH Unrecognized COPY FROM options: maxinserterrors

  12. 12

    How can options be parsed in a Bash script, leaving unrecognized options after the "--"?

  13. 13

    OpenVPN - Options error: Unrecognized option or missing or extra parameter(s) (2.4.5)

  14. 14

    Symfony 3 - Ckeditor bundle : Unrecognized options "template, template_parameters"

  15. 15

    Unrecognized option "firewall_name" under "hwi_oauth"

  16. 16

    Visual Studio 2013 - Debug options missing under configuration options

  17. 17

    parsing all options under select in BeautifulSoup

  18. 18

    options under dropdown menu is not getting selected

  19. 19

    "%1" Application under Change options in Properties window

  20. 20

    Tiny MCE - Restrict the options under "format"

  21. 21

    Java XX command line options unrecognized (e.g: -XX:+UseStringDeduplication, -XX:MaxGCPauseMillis)

  22. 22

    Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`... Did you mean to put these under `headers`?

  23. 23

    Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

  24. 24

    Symfony2 : Unrecognized option "admin" under "security.providers.in_memory.memory"

  25. 25

    sylius: after doing composer update on sylius 0.16 i get 'Unrecognized option "classes" under "sylius_product"

  26. 26

    Unrecognized option "csrf_token_generator" under "security.firewalls.main.form_login"

  27. 27

    NSString under ARC may cause -[__NSArrayM length]: unrecognized selector sent to instance?

  28. 28

    Symfony2 Unrecognized option "providers" under "security.providers.chain_provider"

  29. 29

    Boost.Program_options not linking correctly under Clang

HotTag

Archive