You are here

protected function PanelizerIntegrationTest::changeLayout in Panelizer 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/PanelizerIntegrationTest.php \Drupal\Tests\panelizer\FunctionalJavascript\PanelizerIntegrationTest::changeLayout()
2 calls to PanelizerIntegrationTest::changeLayout()
PanelizerIntegrationTest::testIPEChangeLayout in tests/src/FunctionalJavascript/PanelizerIntegrationTest.php
Tests that changing layout from one (default) to two columns works.
PanelizerIntegrationTest::testUserEditSession in tests/src/FunctionalJavascript/PanelizerIntegrationTest.php
Tests that the IPE editing session is specific to a user.

File

tests/src/FunctionalJavascript/PanelizerIntegrationTest.php, line 144

Class

PanelizerIntegrationTest
Tests the JavaScript functionality of Panels IPE with Panelizer.

Namespace

Drupal\Tests\panelizer\FunctionalJavascript

Code

protected function changeLayout($category, $layout_id) {

  // Open the "Change Layout" tab.
  $this
    ->clickAndWait('[data-tab-id="change_layout"]');

  // Wait for layouts to be pulled into our collection.
  $this
    ->waitUntilNotPresent('.ipe-icon-loading');

  // Select the target category.
  $this
    ->clickAndWait('[data-category="' . $category . '"]');

  // Select the target layout.
  $this
    ->clickAndWait('[data-layout-id="' . $layout_id . '"]');

  // Wait for the form to load/submit.
  $this
    ->waitUntilNotPresent('.ipe-icon-loading');

  // See if the layout has a settings form (new in Drupal 8.8), and if so,
  // submit it without making any changes. This is the only difference
  // between this method and the one inherited from PanelsIPETestTrait.
  $layout_form = $this
    ->getSession()
    ->getPage()
    ->find('css', '.panels-ipe-layout-form');
  if ($layout_form) {
    $layout_form
      ->pressButton('Change Layout');
  }

  // Wait for the edit tab to become active (happens automatically after
  // form submit).
  $this
    ->waitUntilVisible('[data-tab-id="edit"].active');
}