You are here

public function PanelizerContext::removeBlock in Lightning Layout 8

Removes a block from a Panelizer layout via the wizard.

Assumes that exactly one block with the given name exists in the given region.

@When I remove the :label block from the :region panelizer region

Parameters

string $label: The label of the block to remove.

string $region: The machine name of the region in which the block is currently placed.

File

tests/contexts/PanelizerContext.behat.inc, line 54

Class

PanelizerContext

Namespace

Acquia\LightningExtension\Context

Code

public function removeBlock($label, $region) {
  $row = $this
    ->assertBlock($label, $region);
  $assert = $this
    ->assertSession();
  $drop_button = $assert
    ->elementExists('css', 'ul.dropbutton', $row);
  $assert
    ->elementExists('css', 'li.dropbutton-toggle', $drop_button)
    ->click();
  $assert
    ->elementExists('named', [
    'link',
    'Delete',
  ], $drop_button)
    ->click();
}