Skip to content

Commit fe9f729

Browse files
Chris BurgessAlexSkrypnyk
authored andcommitted
Wait for AJAX to complete on Behat's :Behat\MinkExtension\Context\MinkContext::attachFileToField()
Drupal 8 Media performs AJAX after a file is selected in the media upload widget, and we should wait for that to complete. - https://github.com/Behat/MinkExtension/blob/80f7849ba53867181b7e412df9210e12fba50177/src/Behat/MinkExtension/Context/MinkContext.php#L200-L219
1 parent 5b61482 commit fe9f729

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Drupal/DrupalExtension/Context/MinkContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function beforeJavascriptStep($event)
103103
return;
104104
}
105105
$text = $event->getStep()->getText();
106-
if (preg_match('/\b(follow|press|click|submit)\b/i', $text)) {
106+
if (preg_match('/\b(follow|press|click|submit|attach)\b/i', $text)) {
107107
$this->iWaitForAjaxToFinish($event);
108108
}
109109
}
@@ -120,7 +120,7 @@ public function afterJavascriptStep($event)
120120
return;
121121
}
122122
$text = $event->getStep()->getText();
123-
if (preg_match('/\b(follow|press|click|submit)\b/i', $text)) {
123+
if (preg_match('/\b(follow|press|click|submit|attach)\b/i', $text)) {
124124
$this->iWaitForAjaxToFinish($event);
125125
}
126126
}

0 commit comments

Comments
 (0)