ConfigEntityTest.php 969 Bytes
Newer Older
1 2 3 4
<?php

namespace Drupal\Tests\config\FunctionalJavascript;

5
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
6 7 8 9 10 11

/**
 * Tests the Config operations through the UI.
 *
 * @group config
 */
12
class ConfigEntityTest extends WebDriverTestBase {
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

  /**
   * {@inheritdoc}
   */
  public static $modules = ['config_test'];

  /**
   * Tests ajax operations through the UI on 'Add' page.
   */
  public function testAjaxOnAddPage() {
    $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'));
  }

}