function EditModeTest::assertAnnounceLeaveEditMode

Same name in other branches
  1. 9 core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php \Drupal\Tests\contextual\FunctionalJavascript\EditModeTest::assertAnnounceLeaveEditMode()
  2. 8.9.x core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php \Drupal\Tests\contextual\FunctionalJavascript\EditModeTest::assertAnnounceLeaveEditMode()
  3. 10 core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php \Drupal\Tests\contextual\FunctionalJavascript\EditModeTest::assertAnnounceLeaveEditMode()

Assert that the correct message was announced when leaving edit mode.

@internal

1 call to EditModeTest::assertAnnounceLeaveEditMode()
EditModeTest::testEditModeEnableDisable in core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php
Tests enabling and disabling edit mode.

File

core/modules/contextual/tests/src/FunctionalJavascript/EditModeTest.php, line 145

Class

EditModeTest
Tests edit mode.

Namespace

Drupal\Tests\contextual\FunctionalJavascript

Code

protected function assertAnnounceLeaveEditMode() : void {
    $web_assert = $this->assertSession();
    $page = $this->getSession()
        ->getPage();
    // Wait till all the contextual links are hidden.
    $page->waitFor(1, function () use ($page) {
        return empty($page->find('css', '.contextual .trigger.visually-hidden'));
    });
    $web_assert->elementContains('css', static::ANNOUNCE_SELECTOR, 'Tabbing is no longer constrained by the Contextual module.');
    $web_assert->elementNotContains('css', static::ANNOUNCE_SELECTOR, 'Tabbing is constrained to a set of');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.