function ConfigEntityTest::testAjaxOnAddPage

Same name in other branches
  1. 9 core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php \Drupal\Tests\config\FunctionalJavascript\ConfigEntityTest::testAjaxOnAddPage()
  2. 8.9.x core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php \Drupal\Tests\config\FunctionalJavascript\ConfigEntityTest::testAjaxOnAddPage()
  3. 11.x core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php \Drupal\Tests\config\FunctionalJavascript\ConfigEntityTest::testAjaxOnAddPage()

Tests ajax operations through the UI on 'Add' page.

File

core/modules/config/tests/src/FunctionalJavascript/ConfigEntityTest.php, line 29

Class

ConfigEntityTest
Tests the Config operations through the UI.

Namespace

Drupal\Tests\config\FunctionalJavascript

Code

public function testAjaxOnAddPage() : void {
    $this->drupalLogin($this->drupalCreateUser([
        'administer site configuration',
    ]));
    $page = $this->getSession()
        ->getPage();
    $assert_session = $this->assertSession();
    $this->drupalGet('admin/structure/config_test/add');
    // Test that 'size value' field is not show initially, and it is show after
    // selecting value in the 'size' field.
    $this->assertNull($page->findField('size_value'));
    $page->findField('size')
        ->setValue('custom');
    $this->assertNotNull($assert_session->waitForField('size_value'));
}

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