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

The beforeJavascriptStep doesn't check all tags #468

Closed
jhedstrom opened this issue Feb 26, 2018 · 2 comments
Closed

The beforeJavascriptStep doesn't check all tags #468

jhedstrom opened this issue Feb 26, 2018 · 2 comments
Labels
Milestone

Comments

@jhedstrom
Copy link
Owner

This code in MinkContext::beforeJavascriptStep() doesn't find tags at the scenario level, only at the feature-file level:

    public function beforeJavascriptStep($event)
    {
        /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
        $tags = $event->getFeature()->getTags();
        if (!in_array('javascript', $tags)) {
            return;
        }

instead, it should check both the feature, and the scenarios, something like:

  $tags = $event->getFeature()->getTags();
  foreach ($event->getFeature()->getScenarios() as $scenario) {
    $tags = array_merge($tags, $scenario->getTags());
  }
@jhedstrom
Copy link
Owner Author

Hmm, this is actually tricky sine StepNodes have no way of getting the scenario they are in, so we can't just loop through all scenarios since some might not be @javascript...

@jhedstrom
Copy link
Owner Author

In some manual testing (on Behat 3.3), tags do still appear to filter before/after steps, which is in contradiction to Behat/Behat#650...

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

No branches or pull requests

1 participant