You are here

protected function LayoutBuilderQuickEditTest::createLayoutOverride in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest::createLayoutOverride()

Creates a layout override.

File

core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php, line 271

Class

LayoutBuilderQuickEditTest
Tests that Layout Builder functions with Quick Edit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

protected function createLayoutOverride() {
  $page = $this
    ->getSession()
    ->getPage();
  $assert_session = $this
    ->assertSession();

  // Save the current user to re-login after Layout Builder changes.
  $user = $this->loggedInUser;
  $this
    ->loginLayoutAdmin();
  $this
    ->drupalGet('node/' . $this->article
    ->id() . '/layout');
  $page
    ->pressButton('Save layout');
  $this
    ->assertNotEmpty($assert_session
    ->waitForElement('css', '.messages--status'));
  $assert_session
    ->pageTextContains('The layout override has been saved.');
  $this
    ->drupalLogin($user);
}