You are here

public function LingotekSettingsTabContentFormWithLotsOfContentTest::testWhenEnabledNodeArticleDefaultsAreSet in Lingotek Translation 3.0.x

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

File

tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php, line 73

Class

LingotekSettingsTabContentFormWithLotsOfContentTest
@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-readonly-enabled');
  $this
    ->assertNoFieldChecked('edit-node-article-readonly-fields-title');
  $this
    ->assertNoFieldChecked('edit-node-article-readonly-fields-body');
  $this
    ->assertNoFieldChecked('edit-node-article-readonly-fields-field-image');
  $this
    ->assertNoFieldChecked('edit-node-article-readonly-fields-field-imageproperties-file');
  $this
    ->assertNoFieldChecked('edit-node-article-readonly-fields-field-imageproperties-alt');
  $this
    ->assertNoFieldChecked('edit-node-article-readonly-fields-field-imageproperties-title');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-enabled');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-title');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-body');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-image');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-imageproperties-file');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-imageproperties-alt');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-imageproperties-title');
  $linkToOpenDialog = $page
    ->find('css', '#edit-node-article-content-type-edit');
  $linkToOpenDialog
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertSession()
    ->waitForElementVisible('css', '#drupal-modal');
  $this
    ->assertNoFieldChecked('node[article][enabled]');
  $this
    ->assertNoFieldChecked('node[article][fields][title]');
  $this
    ->assertNoFieldChecked('node[article][fields][body]');
  $this
    ->assertNoFieldChecked('node[article][fields][field_image]');
  $this
    ->assertNoFieldChecked('node[article][fields][field_image:properties][file]');
  $this
    ->assertNoFieldChecked('node[article][fields][field_image:properties][alt]');
  $this
    ->assertNoFieldChecked('node[article][fields][field_image:properties][title]');
  $fieldEnabled = $page
    ->find('css', 'input[name="node[article][enabled]"]');
  $fieldEnabled
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertFieldChecked('node[article][enabled]');
  $this
    ->assertFieldChecked('node[article][fields][title]');
  $this
    ->assertFieldChecked('node[article][fields][body]');
  $this
    ->assertFieldChecked('node[article][fields][field_image]');
  $this
    ->assertNoFieldChecked('node[article][fields][field_image:properties][file]');
  $this
    ->assertFieldChecked('node[article][fields][field_image:properties][alt]');
  $this
    ->assertFieldChecked('node[article][fields][field_image:properties][title]');
  $button_pane_buttons = $this
    ->getSession()
    ->getPage()
    ->findAll('css', '.ui-dialog-buttonpane button');
  $this
    ->assertCount(1, $button_pane_buttons);
  $button = $button_pane_buttons[0];
  $button
    ->press();
  $this
    ->assertSession()
    ->elementTextContains('css', '.messages.messages--status', 'The configuration options have been saved.');
  $page = $this
    ->getSession()
    ->getPage();
  $contentTabDetails = $page
    ->find('css', '#edit-parent-details');
  $contentTabDetails
    ->click();
  $nodeTabDetails = $page
    ->find('css', '#edit-entity-node');
  $nodeTabDetails
    ->click();
  $this
    ->assertFieldChecked('edit-node-article-readonly-enabled');
  $this
    ->assertFieldChecked('edit-node-article-readonly-fields-title');
  $this
    ->assertFieldChecked('edit-node-article-readonly-fields-body');
  $this
    ->assertFieldChecked('edit-node-article-readonly-fields-field-image');
  $this
    ->assertNoFieldChecked('edit-node-article-readonly-fields-field-imageproperties-file');
  $this
    ->assertFieldChecked('edit-node-article-readonly-fields-field-imageproperties-alt');
  $this
    ->assertFieldChecked('edit-node-article-readonly-fields-field-imageproperties-title');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-enabled');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-title');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-body');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-image');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-imageproperties-file');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-imageproperties-alt');
  $this
    ->assertSession()
    ->fieldDisabled('edit-node-article-readonly-fields-field-imageproperties-title');
}