function AdminAjaxTest::testBodyScroll

Same name in other branches
  1. 11.x core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php \Drupal\Tests\views_ui\FunctionalJavascript\AdminAjaxTest::testBodyScroll()

Tests body scroll.

File

core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php, line 67

Class

AdminAjaxTest
Tests the admin UI AJAX interactions.

Namespace

Drupal\Tests\views_ui\FunctionalJavascript

Code

public function testBodyScroll() : void {
    $this->drupalGet('admin/structure/views/view/user_admin_people');
    $page = $this->getSession()
        ->getPage();
    foreach ([
        'name[views.nothing]',
        'name[views.dropbutton]',
    ] as $field) {
        $page->find('css', '#views-add-field')
            ->click();
        $this->assertSession()
            ->assertWaitOnAjaxRequest();
        $page->checkField($field);
        $page->find('css', '.ui-dialog-buttonset')
            ->pressButton('Add and configure fields');
        $this->assertSession()
            ->assertWaitOnAjaxRequest();
        $this->assertJsCondition('document.documentElement.style.overflow === "hidden"');
        $page->find('css', '.ui-dialog-buttonset')
            ->pressButton('Apply');
        $this->assertSession()
            ->assertWaitOnAjaxRequest();
        // Check overflow.
        $this->assertJsCondition('document.documentElement.style.overflow !== "hidden"');
    }
}

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