You are here

protected function PanelsIPETestTrait::removeBlock in Panels 8.3

Same name and namespace in other branches
  1. 8.4 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 189

Class

PanelsIPETestTrait
Trait which can be used to test Panels IPE components.

Namespace

Drupal\Tests\panels_ipe\FunctionalJavascript

Code

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
    ->assertElementNotPresent($base_selector, $message);
}