Completed
Push — 3.2 ( 51a84d...abe3a3 )
by Jonathan
8s
created

BatchContext::iWaitForTheBatchJobToFinish()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Drupal\DrupalExtension\Context;
4
5
use Behat\MinkExtension\Context\RawMinkContext;
6
7
/**
8
 * Extensions to the Mink Extension.
9
 */
10
class BatchContext extends RawMinkContext {
11
12
  /**
13
   * Wait for the Batch API to finish.
14
   *
15
   * Wait until the id="updateprogress" element is gone,
16
   * or timeout after 3 minutes (180,000 ms).
17
   *
18
   * @Given /^I wait for the batch job to finish$/
19
   */
20
  public function iWaitForTheBatchJobToFinish() {
21
    $this->getSession()->wait(180000, 'jQuery("#updateprogress").length === 0');
22
  }
23
24
}
25