Completed
Pull Request — 3.1 (#290)
by
unknown
09:17
created

BatchContext   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 15
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A iWaitForTheBatchJobToFinish() 0 3 1
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