You are here

public function PanelsIPEContext::openTab in Lightning Layout 8

Opens a tab of the Panels IPE tray.

@When I open the :tab tab

Parameters

string $tab: The title of the tab to activate.

Return value

\Behat\Mink\Element\NodeElement The tab contents.

1 call to PanelsIPEContext::openTab()
PanelsIPEContext::openCategory in tests/contexts/PanelsIPEContext.behat.inc
Opens a particular block category of the "Manage Content" tab.

File

tests/contexts/PanelsIPEContext.behat.inc, line 49

Class

PanelsIPEContext
Contains step definitions for interacting with Panels IPE.

Namespace

Acquia\LightningExtension\Context

Code

public function openTab($tab) {
  $assert = $this
    ->assertSession();

  // Assert that the tab exists...
  $link = $assert
    ->elementExists('named', [
    'link',
    $tab,
  ], $assert
    ->elementExists('css', '.ipe-tabs', $this
    ->assertTray()));

  // ...but only open it if not already active.
  if ($link
    ->getParent()
    ->hasClass('active') == FALSE) {
    $link
      ->click();
    $this
      ->awaitAjax();
  }
  return $this
    ->getActiveTab();
}