Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / src / Drupal / DrupalExtension / Context / BatchContext.php
diff --git a/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/BatchContext.php b/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/BatchContext.php
new file mode 100644 (file)
index 0000000..0f7f64e
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\DrupalExtension\Context;
+
+use Behat\MinkExtension\Context\RawMinkContext;
+
+/**
+ * Extensions to the Mink Extension.
+ */
+class BatchContext extends RawMinkContext {
+
+  /**
+   * Wait for the Batch API to finish.
+   *
+   * Wait until the id="updateprogress" element is gone,
+   * or timeout after 3 minutes (180,000 ms).
+   *
+   * @Given /^I wait for the batch job to finish$/
+   */
+  public function iWaitForTheBatchJobToFinish() {
+    $this->getSession()->wait(180000, 'jQuery("#updateprogress").length === 0');
+  }
+
+}