Skip to content

Commit

Permalink
Adds a trait for determining current scenario tags.
Browse files Browse the repository at this point in the history
- Fixes #468
  • Loading branch information
jhedstrom committed Apr 16, 2018
1 parent 8adc65c commit b538db7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Drupal/DrupalExtension/Context/MinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
use Behat\Behat\Context\TranslatableContext;
use Behat\Mink\Exception\UnsupportedDriverActionException;
use Behat\MinkExtension\Context\MinkContext as MinkExtension;
use Drupal\DrupalExtension\ScenarioTagTrait;

/**
* Extensions to the Mink Extension.
*/
class MinkContext extends MinkExtension implements TranslatableContext
{

use ScenarioTagTrait;

/**
* Returns list of definition translation resources paths.
*
Expand Down Expand Up @@ -92,7 +95,7 @@ public function assertEnterField($field, $value)
public function beforeJavascriptStep($event)
{
/** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
$tags = $event->getFeature()->getTags();
$tags = $this->getCurrentScenarioTags($event);
if (!in_array('javascript', $tags)) {
return;
}
Expand All @@ -110,7 +113,7 @@ public function beforeJavascriptStep($event)
public function afterJavascriptStep($event)
{
/** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
$tags = $event->getFeature()->getTags();
$tags = $this->getCurrentScenarioTags($event);
if (!in_array('javascript', $tags)) {
return;
}
Expand Down

0 comments on commit b538db7

Please sign in to comment.