protected function TMGMTUiTest::assertJobItemStateIcon

Asserts task item progress bar.

Parameters

int $row: The row of the item you want to check.

int $state: The expected state.

1 call to TMGMTUiTest::assertJobItemStateIcon()
TMGMTUiTest::testProgress in tests/src/Functional/TMGMTUiTest.php
Tests of the job item review process.

File

tests/src/Functional/TMGMTUiTest.php, line 1061

Class

TMGMTUiTest
Verifies basic functionality of the user interface

Namespace

Drupal\Tests\tmgmt\Functional

Code

protected function assertJobItemStateIcon($row, $state) {
  if ($state == 'Inactive' || $state == 'Aborted' || $state == 'Accepted') {
    $result = $this
      ->xpath('//div[@id="edit-job-items-wrapper"]//tbody/tr[' . $row . ']/td[4]')[0];
    $this
      ->assertEquals($state, trim($result
      ->getHtml()));
  }
  else {
    $result = $this
      ->xpath('//div[@id="edit-job-items-wrapper"]//tbody/tr[' . $row . ']/td[1]/img')[0];
    $this
      ->assertEquals($state, $result
      ->getAttribute('title'));
  }
}