$this->
drupalLogin($account);
} /**
* Tests that the integration with Views works correctly.
*/
public function testViewsAdmin() { $page =
$this->
getSession()->
getPage();
// Assert that the widget can be seen and that there are 8 items.
$this->
drupalGet('/admin/structure/views/view/media_library/edit/widget'
);
$this->
waitForElementsCount('css', '.js-media-library-item', 8
);
// Assert that filtering works in live preview.
$page->
find('css', '.js-media-library-view'
)->
fillField('name', 'snake'
);
$page->
find('css', '.js-media-library-view'
)->
pressButton('Apply filters'
);
$this->
waitForElementsCount('css', '.js-media-library-item', 1
);
// Test the same routine but in the view for the table widget.
$this->
drupalGet('/admin/structure/views/view/media_library/edit/widget_table'
);
$this->
waitForElementsCount('css', '.js-media-library-item', 8
);
// Assert that filtering works in live preview.