You are here

function TMGMTUiJavascriptTest::testCheckoutForm in Translation Management Tool 8

Javascript test for the checkout form.

File

tests/src/FunctionalJavascript/TMGMTUiJavascriptTest.php, line 496

Class

TMGMTUiJavascriptTest
Verifies the UI of the review form.

Namespace

Drupal\Tests\tmgmt\FunctionalJavascript

Code

function testCheckoutForm() {

  // Test for job checkout form, if the target language is supported,
  // the test translator should say it is supported.
  $job = tmgmt_job_create('en', 'de', 0);
  $job
    ->save();
  $page = $this
    ->getSession()
    ->getPage();
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet('admin/tmgmt/jobs/' . $job
    ->id());
  $page
    ->selectFieldOption('Target language', 'de');
  $assert_session
    ->assertWaitOnAjaxRequest();
  $this
    ->assertEquals('Test provider', $assert_session
    ->optionExists('translator', 'test_translator')
    ->getText());
}