class AdminAjaxTest
Same name and namespace in other branches
- 11.x core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php \Drupal\Tests\views_ui\FunctionalJavascript\AdminAjaxTest
- 10 core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php \Drupal\Tests\views_ui\FunctionalJavascript\AdminAjaxTest
Tests the admin UI AJAX interactions.
@group views_ui
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalJavascriptTests\WebDriverTestBase extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\views_ui\FunctionalJavascript\AdminAjaxTest extends \Drupal\FunctionalJavascriptTests\WebDriverTestBase
- class \Drupal\FunctionalJavascriptTests\WebDriverTestBase extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of AdminAjaxTest
File
-
core/
modules/ views_ui/ tests/ src/ FunctionalJavascript/ AdminAjaxTest.php, line 12
Namespace
Drupal\Tests\views_ui\FunctionalJavascriptView source
class AdminAjaxTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'views_ui',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'views_test_classy_subtheme';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->drupalLogin($this->createUser([
'administer views',
]));
}
/**
* Confirms that form_alter is triggered after AJAX rebuilds.
*/
public function testAjaxRebuild() {
\Drupal::service('theme_installer')->install([
'views_test_classy_subtheme',
]);
$this->config('system.theme')
->set('default', 'views_test_classy_subtheme')
->save();
$page = $this->getSession()
->getPage();
$assert_session = $this->assertSession();
$this->drupalGet('admin/structure/views/view/user_admin_people');
$assert_session->pageTextContains('This is text added to the display tabs at the top');
$assert_session->pageTextContains('This is text added to the display edit form');
$page->clickLink('User: Name (Username)');
$assert_session->waitForElementVisible('css', '.views-ui-dialog');
$page->fillField('Label', 'New Title');
$page->find('css', '.ui-dialog-buttonset button:contains("Apply")')
->press();
$assert_session->waitForElementRemoved('css', '.views-ui-dialog');
$assert_session->pageTextContains('This is text added to the display tabs at the top');
$assert_session->pageTextContains('This is text added to the display edit form');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.