function ClaroViewsUiTest::testViewsUiTabsCssClasses

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroViewsUiTest::testViewsUiTabsCssClasses()
  2. 8.9.x core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroViewsUiTest::testViewsUiTabsCssClasses()
  3. 11.x core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php \Drupal\FunctionalJavascriptTests\Theme\ClaroViewsUiTest::testViewsUiTabsCssClasses()

Tests Views UI display menu tabs CSS classes.

Ensures that the CSS classes added to display menu tabs are preserved when Views UI is updated with AJAX.

File

core/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroViewsUiTest.php, line 50

Class

ClaroViewsUiTest
Runs tests on Views UI using Claro.

Namespace

Drupal\FunctionalJavascriptTests\Theme

Code

public function testViewsUiTabsCssClasses() : void {
    $this->drupalGet('admin/structure/views/view/who_s_online');
    $assert_session = $this->assertSession();
    $assert_session->elementExists('css', '#views-display-menu-tabs.views-tabs.views-tabs--secondary');
    // Click on the Display name and wait for the Views UI dialog.
    $assert_session->elementExists('css', '#edit-display-settings-top .views-display-setting a')
        ->click();
    $this->assertNotNull($this->assertSession()
        ->waitForElement('css', '.js-views-ui-dialog'));
    // Click the Apply button of the dialog.
    $assert_session->elementExists('css', '.js-views-ui-dialog .ui-dialog-buttonpane')
        ->findButton('Apply')
        ->press();
    // Wait for AJAX to finish.
    $assert_session->assertWaitOnAjaxRequest();
    // Check that the display menu tabs list still has the expected CSS classes.
    $assert_session->elementExists('css', '#views-display-menu-tabs.views-tabs.views-tabs--secondary');
}

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