You are here

protected function PanelsIPETestTrait::breakLock in Panels 8.4

Breaks the lock of an IPE session.

1 call to PanelsIPETestTrait::breakLock()
PageManagerIntegrationTest::testUserEditSession in panels_ipe/tests/src/FunctionalJavascript/PageManagerIntegrationTest.php
Tests that the IPE editing session is specific to a user.

File

panels_ipe/tests/src/FunctionalJavascript/PanelsIPETestTrait.php, line 69

Class

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

Namespace

Drupal\Tests\panels_ipe\FunctionalJavascript

Code

protected function breakLock() {
  $session = $this
    ->getSession();

  // Click the "Locked" tab.
  $selector = '[data-tab-id="locked"]:not(.active)';
  $inactive_tab = $session
    ->getPage()
    ->find('css', $selector);
  if ($inactive_tab) {
    $inactive_tab
      ->click();
    $driver = $session
      ->getDriver();
    if ($driver instanceof Selenium2Driver) {
      $driver
        ->getWebDriverSession()
        ->accept_alert();
    }
  }
}