Skip to content

Commit

Permalink
BeforeStep and AfterStep no longer support tags in Behat 3.
Browse files Browse the repository at this point in the history
Fixes #92.
  • Loading branch information
pfrenssen committed Jan 30, 2017
1 parent b8c127e commit c174852
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Drupal/DrupalExtension/Context/MinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,14 @@ public function assertEnterField($field, $value) {
/**
* For javascript enabled scenarios, always wait for AJAX before clicking.
*
* @BeforeStep @javascript
* @BeforeStep
*/
public function beforeJavascriptStep($event) {
/** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
$tags = $event->getFeature()->getTags();
if (!in_array('javascript', $tags)) {
return;
}
$text = $event->getStep()->getText();
if (preg_match('/(follow|press|click|submit)/i', $text)) {
$this->iWaitForAjaxToFinish();
Expand All @@ -94,9 +99,14 @@ public function beforeJavascriptStep($event) {
/**
* For javascript enabled scenarios, always wait for AJAX after clicking.
*
* @AfterStep @javascript
* @AfterStep
*/
public function afterJavascriptStep($event) {
/** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
$tags = $event->getFeature()->getTags();
if (!in_array('javascript', $tags)) {
return;
}
$text = $event->getStep()->getText();
if (preg_match('/(follow|press|click|submit)/i', $text)) {
$this->iWaitForAjaxToFinish();
Expand Down

0 comments on commit c174852

Please sign in to comment.