You are here

private function TMGMTUiTest::assertJobStateIcon in Translation Management Tool 8

Asserts task item progress bar.

Parameters

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

int $state: The expected state.

2 calls to TMGMTUiTest::assertJobStateIcon()
TMGMTUiTest::testAbortJob in tests/src/Functional/TMGMTUiTest.php
Test the process of aborting and resubmitting the job.
TMGMTUiTest::testProgress in tests/src/Functional/TMGMTUiTest.php
Tests of the job item review process.

File

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

Class

TMGMTUiTest
Verifies basic functionality of the user interface

Namespace

Drupal\Tests\tmgmt\Functional

Code

private function assertJobStateIcon($row, $state) {
  if ($state == 'Unprocessed' || $state == 'Rejected' || $state == 'Aborted' || $state == 'Finished') {
    $result = $this
      ->xpath('//table/tbody/tr[' . $row . ']/td[6]')[0];
    $this
      ->assertEqual(trim($result
      ->getHtml()), $state);
  }
  else {
    $result = $this
      ->xpath('//table/tbody/tr[' . $row . ']/td[1]/img')[0];
    $this
      ->assertEqual($result
      ->getAttribute('title'), $state);
  }
}