You are here

public function EntityDisplayTest::testExtraFields in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php \Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest::testExtraFields()

Tests extra fields.

1 method overrides EntityDisplayTest::testExtraFields()
ClaroEntityDisplayTest::testExtraFields in core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php
Copied from parent.

File

core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php, line 100

Class

EntityDisplayTest
Tests the UI for entity displays.

Namespace

Drupal\Tests\field_ui\FunctionalJavascript

Code

public function testExtraFields() {
  entity_test_create_bundle('bundle_with_extra_fields');
  $this
    ->drupalGet('entity_test/structure/bundle_with_extra_fields/display');
  $this
    ->assertSession()
    ->waitForElement('css', '.tabledrag-handle');
  $id = $this
    ->getSession()
    ->getPage()
    ->find('css', '[name="form_build_id"]')
    ->getValue();
  $extra_field_row = $this
    ->getSession()
    ->getPage()
    ->find('css', '#display-extra-field');
  $disabled_region_row = $this
    ->getSession()
    ->getPage()
    ->find('css', '.region-hidden-title');
  $extra_field_row
    ->find('css', '.handle')
    ->dragTo($disabled_region_row);
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertSession()
    ->waitForElement('css', "[name='form_build_id']:not([value='{$id}'])");
  $this
    ->submitForm([], 'Save');
  $this
    ->assertSession()
    ->pageTextContains('Your settings have been saved.');
}