You are here

protected function InlineBlockTestBase::assertSaveLayout in Drupal 9

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

Saves a layout and asserts the message is correct.

7 calls to InlineBlockTestBase::assertSaveLayout()
InlineBlockPrivateFilesTest::testPrivateFiles in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
Tests access to private files added to inline blocks in the layout builder.
InlineBlockTest::testAccess in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests access to the block edit form of inline blocks.
InlineBlockTest::testDeletion in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests that entity blocks deleted correctly.
InlineBlockTest::testInlineBlocks in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests adding and editing of inline blocks.
InlineBlockTest::testInlineBlocksRevisioning in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests entity blocks revisioning.

... See full list

File

core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php, line 79

Class

InlineBlockTestBase
Base class for testing inline blocks.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

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

  // Reload the page to prevent random failures.
  $this
    ->drupalGet($this
    ->getUrl());
  $page
    ->pressButton('Save layout');
  $this
    ->assertNotEmpty($assert_session
    ->waitForElement('css', '.messages--status'));
  if (stristr($this
    ->getUrl(), 'admin/structure') === FALSE) {
    $assert_session
      ->pageTextContains('The layout override has been saved.');
  }
  else {
    $assert_session
      ->pageTextContains('The layout has been saved.');
  }
}