function ClaroEntityDisplayTest::testExtraFields

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroEntityDisplayTest::testExtraFields()
  2. 8.9.x core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroEntityDisplayTest::testExtraFields()
  3. 10 core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroEntityDisplayTest::testExtraFields()

Copied from parent.

This is Drupal\Tests\field_ui\FunctionalJavascript\EntityDisplayTest::testExtraFields() with a line changed to reflect Claro's tabledrag selector.

Overrides EntityDisplayTest::testExtraFields

File

core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroEntityDisplayTest.php, line 98

Class

ClaroEntityDisplayTest
Runs EntityDisplayTest in Claro.

Namespace

Drupal\FunctionalJavascriptTests\Theme

Code

public function testExtraFields() : void {
    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', '.js-tabledrag-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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.