You are here

protected function ContentPreviewToggleTest::assertContextualLinks in Drupal 9

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

Checks if contextual links are working properly.

1 call to ContentPreviewToggleTest::assertContextualLinks()
ContentPreviewToggleTest::testContentPreviewToggle in core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php
Tests the content preview toggle.

File

core/modules/layout_builder/tests/src/FunctionalJavascript/ContentPreviewToggleTest.php, line 127

Class

ContentPreviewToggleTest
Tests toggling of content preview.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function assertContextualLinks() {
  $page = $this
    ->getSession()
    ->getPage();
  $assert_session = $this
    ->assertSession();
  $this
    ->clickContextualLink('.block-field-blocknodebundle-for-this-particular-testbody', 'Configure');
  $this
    ->assertNotEmpty($assert_session
    ->waitForElement('css', "#drupal-off-canvas"));
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertNotEmpty($this
    ->assertSession()
    ->waitForButton('Close'));
  $page
    ->pressButton('Close');
  $assert_session
    ->assertNoElementAfterWait('css', '#drupal-off-canvas');
}