$page->
find('css', '#edit-blocks-region-header-title'
)->
click();
$filter =
$assertSession->
waitForElement('css', '.block-filter-text'
);
// Get all block rows, for assertions later.
$block_rows =
$page->
findAll('css', '.block-add-table tbody tr'
);
// Test block filter reduces the number of visible rows.
$filter->
setValue('ad'
);
$session->
wait(10000, 'jQuery("#drupal-live-announce").html().indexOf("blocks are available") > -1'
);
$visible_rows =
$this->
filterVisibleElements($block_rows);
if (count($block_rows) > 0
) { $this->
assertNotSameSize($block_rows,
$visible_rows);
} // Test Drupal.announce() message when multiple matches are expected.
$expected_message =
count($visible_rows) . ' blocks are available in the modified list.';
$assertSession->
elementTextContains('css', '#drupal-live-announce',
$expected_message);
// Test Drupal.announce() message when only one match is expected.
$filter->
setValue('Powered by'
);
$session->
wait(10000, 'jQuery("#drupal-live-announce").html().indexOf("block is available") > -1'
);
$visible_rows =
$this->
filterVisibleElements($block_rows);
$this->
assertCount(1,
$visible_rows);