Skip to content

Commit

Permalink
Merge pull request #561 from weynhamz/fix-wrongly-matching-keywords
Browse files Browse the repository at this point in the history
Add space arround the keywords to avoid wrongly matching.
  • Loading branch information
jhedstrom authored Dec 31, 2019
2 parents 20f1f41 + f9f3fb9 commit c981fbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Drupal/DrupalExtension/Context/MinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function beforeJavascriptStep($event)
return;
}
$text = $event->getStep()->getText();
if (preg_match('/(follow|press|click|submit)/i', $text)) {
if (preg_match('/\b(follow|press|click|submit)\b/i', $text)) {
$this->iWaitForAjaxToFinish($event);
}
}
Expand All @@ -120,7 +120,7 @@ public function afterJavascriptStep($event)
return;
}
$text = $event->getStep()->getText();
if (preg_match('/(follow|press|click|submit)/i', $text)) {
if (preg_match('/\b(follow|press|click|submit)\b/i', $text)) {
$this->iWaitForAjaxToFinish($event);
}
}
Expand Down

0 comments on commit c981fbb

Please sign in to comment.