You are here

private function LayoutBuilderTest::enableLayoutsForBundle in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::enableLayoutsForBundle()
  2. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::enableLayoutsForBundle()

Enable layouts.

Parameters

string $path: The path for the manage display page.

bool $allow_custom: Whether to allow custom layouts.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php, line 452

Class

LayoutBuilderTest
Tests the Layout Builder UI.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

private function enableLayoutsForBundle($path, $allow_custom = FALSE) {
  $assert_session = $this
    ->assertSession();
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->drupalGet($path);
  $page
    ->checkField('layout[enabled]');
  if ($allow_custom) {
    $this
      ->assertNotEmpty($assert_session
      ->waitForElementVisible('css', 'input[name="layout[allow_custom]"]'));
    $page
      ->checkField('layout[allow_custom]');
  }
  $page
    ->pressButton('Save');
  $this
    ->assertNotEmpty($assert_session
    ->waitForElementVisible('css', '#edit-manage-layout'));
  $assert_session
    ->linkExists('Manage layout');
}