You are here

public function LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  2. 4.0.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  3. 3.0.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  4. 3.1.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  5. 3.3.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  6. 3.4.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  7. 3.5.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  8. 3.6.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  9. 3.7.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()
  10. 3.8.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenEnabledNodeArticleDefaultsAreSet()

File

tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php, line 58

Class

LingotekSettingsTabContentFormTest
@group lingotek

Namespace

Drupal\Tests\lingotek\FunctionalJavascript

Code

public function testWhenEnabledNodeArticleDefaultsAreSet() {
  $this
    ->drupalGet('/admin/lingotek/settings');
  $page = $this
    ->getSession()
    ->getPage();
  $contentTabDetails = $page
    ->find('css', '#edit-parent-details');
  $contentTabDetails
    ->click();
  $nodeTabDetails = $page
    ->find('css', '#edit-entity-node');
  $nodeTabDetails
    ->click();
  $this
    ->assertNoFieldChecked('edit-node-article-enabled');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-title');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-body');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-text');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-image');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-file');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-alt');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-title');
  $fieldEnabled = $page
    ->find('css', '#edit-node-article-enabled');
  $fieldEnabled
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertFieldChecked('edit-node-article-enabled');
  $this
    ->assertFieldChecked('edit-node-article-fields-title');
  $this
    ->assertFieldChecked('edit-node-article-fields-body');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-text');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-image');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-file');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-imageproperties-alt');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-imageproperties-title');
  $this
    ->drupalPostForm(NULL, [], 'Save', [], 'lingoteksettings-tab-content-form');
  $this
    ->assertSession()
    ->elementTextContains('css', '.messages.messages--status', 'The configuration options have been saved.');
  $this
    ->assertFieldChecked('edit-node-article-enabled');
  $this
    ->assertFieldChecked('edit-node-article-fields-title');
  $this
    ->assertFieldChecked('edit-node-article-fields-body');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-text');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-image');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-file');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-imageproperties-alt');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-imageproperties-title');
}