Behat / Symfony2Extension

Symfony2 extension for Behat
MIT License
392 stars 106 forks source link

Behat did not find any feature with SF3 #123

Open OskarStark opened 7 years ago

OskarStark commented 7 years ago

Hi guys,

this is my behat.yml:

default:
    extensions:
        FriendsOfBehat\PerformanceExtension: ~
        Behat\Symfony2Extension: ~

        Behat\MinkExtension:
            sessions:
                my_session:
                    symfony2: ~

    suites:
        app_bundle_suite:
            type:   symfony_bundle
            bundle: AppBundle
            contexts: [ Tests\AppBundle\Features\Context\HeadlessContext ]

and the following versions:

# composer show | grep behat
Do not run Composer as root/super user! See https://getcomposer.org/root for details
behat/behat                              v3.3.1  Scenario-oriented BDD framework for PHP 5.3
behat/gherkin                            v4.4.5  Gherkin DSL parser for PHP 5.3
behat/mink                               v1.7.1  Browser controller/emulator abstraction for PHP
behat/mink-browserkit-driver             v1.3.2  Symfony2 BrowserKit driver for Mink framework
behat/mink-extension                     v2.2    Mink extension for Behat
behat/symfony2-extension                 2.1.1   Symfony2 framework extension for Behat
behat/transliterator                     v1.2.0  String transliterator
friends-of-behat/performance-extension   v1.0.2  Accelerates Behat using features available only for newer PHP versions.
# vendor/bin/behat
No scenarios
No steps
0m0.06s (14.54Mb)

I have login.feature which is located here: src/tests/AppBundle/Features/login.feature

Would be great to get a hint what to change to get this working!

Cheers, Oskar

OskarStark commented 7 years ago

This is my file structure: screenshot 2017-08-22 16 03 10

OskarStark commented 7 years ago

This line fixes it:

default:
    extensions:
        FriendsOfBehat\PerformanceExtension: ~
        Behat\Symfony2Extension: ~

        Behat\MinkExtension:
            sessions:
                my_session:
                    symfony2: ~

    suites:
        app_bundle_suite:
+           paths:
+              features: tests/
            type:   symfony_bundle
            bundle: AppBundle
            contexts: [ Tests\AppBundle\Features\Context\HeadlessContext ]

Maybe the default value could be changed based on the Sf version?

mvhirsch commented 7 years ago

Would be nice to have a feature, that autoloads tests automatically from a Symfony3 filesystem structure!

OskarStark commented 7 years ago

:+1: