protected function LayoutBuilderUiTest::assertModifiedLayout in Drupal 9
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderUiTest::assertModifiedLayout()
Asserts that modifying a layout works as expected.
Parameters
string $path: The path to a Layout Builder UI page.
1 call to LayoutBuilderUiTest::assertModifiedLayout()
- LayoutBuilderUiTest::testUnsavedChangesMessage in core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderUiTest.php - Tests the message indicating unsaved changes.
File
- core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderUiTest.php, line 109
Class
- LayoutBuilderUiTest
- Tests the Layout Builder UI.
Namespace
Drupal\Tests\layout_builder\FunctionalJavascriptCode
protected function assertModifiedLayout($path) {
$assert_session = $this
->assertSession();
$page = $this
->getSession()
->getPage();
$this
->drupalGet($path);
$page
->clickLink('Add section');
$assert_session
->waitForElementVisible('named', [
'link',
'One column',
]);
$assert_session
->pageTextNotContains('You have unsaved changes.');
$page
->clickLink('One column');
$assert_session
->waitForElementVisible('named', [
'button',
'Add section',
]);
$page
->pressButton('Add section');
$assert_session
->assertWaitOnAjaxRequest();
$assert_session
->pageTextContainsOnce('You have unsaved changes.');
// Reload the page.
$this
->drupalGet($path);
$assert_session
->pageTextContainsOnce('You have unsaved changes.');
}