protected function PanelsIPETestTrait::removeBlock in Panels 8.4
Same name and namespace in other branches
- 8.3 panels_ipe/tests/src/FunctionalJavascript/PanelsIPETestTrait.php \Drupal\Tests\panels_ipe\FunctionalJavascript\PanelsIPETestTrait::removeBlock()
Removes a Block from the page.
Parameters
string $block_id: The unique ID of the Block you want to remove.
File
- panels_ipe/
tests/ src/ FunctionalJavascript/ PanelsIPETestTrait.php, line 216
Class
- PanelsIPETestTrait
- Trait which can be used to test Panels IPE components.
Namespace
Drupal\Tests\panels_ipe\FunctionalJavascriptCode
protected function removeBlock($block_id) {
$base_selector = '[data-block-id="' . $block_id . '"]';
$remove_selector = $base_selector . ' [data-action-id="remove"]';
// Enable the in place editor and click the remove (X) button.
$this
->enableEditing();
$this
->clickAndWait($remove_selector);
// Ensure that the Block is removed.
$message = 'Block does not exist after removal';
$this
->assertSession()
->elementNotExists($base_selector, $message);
}