Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From the docs: features/bootstrap/FeatureContext.php is for testing the Drupal Extension itself #112

Closed
amitaibu opened this issue Nov 30, 2014 · 5 comments

Comments

@amitaibu
Copy link
Contributor

So where should my FeatureContext.php exist? And how should I add it (i guess through context in behat.yml -- but an example with namespaces would be appreciated)

@jhedstrom
Copy link
Owner

That comment is quite confusing. The intent there is to refer to the one that comes with the Drupal Extension itself--features/bootstrap/FeatureContext.php is still the preferred place for custom contexts.

In most examples I've read, custom contexts are not namespaced.

We're about to do a docs cleanup, so I'll make sure that is clarified.

@amitaibu
Copy link
Contributor Author

amitaibu commented Dec 1, 2014

features/bootstrap/FeatureContext.php is still the preferred place for custom contexts.

And for Behat to pick this file up -- should I add something in behat.yml's context - cause it seems it is ignored.

@jhedstrom
Copy link
Owner

Yes, unlike in Behat 2, the FeatureContext (or WhateverContext) must be specified in each suite:

default:
  suites:
    default:
      contexts:
        - Drupal\DrupalExtension\Context\DrupalContext
        - FeatureContext
        - WhateverContext

@amitaibu
Copy link
Contributor Author

amitaibu commented Dec 1, 2014

I think it's worth adding in the README .. :)

@eliza411
Copy link
Collaborator

I think I've added what was requested. If not, please reopen with concrete suggestions! Thanks for taking time to help improve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants