function UiHelperTrait::assertSession

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::assertSession()
  2. 10 core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::assertSession()
  3. 11.x core/tests/Drupal/Tests/UiHelperTrait.php \Drupal\Tests\UiHelperTrait::assertSession()

Returns WebAssert object.

Parameters

string $name: (optional) Name of the session. Defaults to the active session.

Return value

\Drupal\Tests\WebAssert A new web-assert option for asserting the presence of elements with.

200 calls to UiHelperTrait::assertSession()
AddedStylesheetsTest::testCkeditorStylesheets in core/modules/ckeditor5/tests/src/Functional/AddedStylesheetsTest.php
Test the ckeditor5-stylesheets theme config.
AggregatorDisplayConfigurableTest::testFeedDisplayConfigurable in core/modules/aggregator/tests/src/Functional/AggregatorDisplayConfigurableTest.php
Tests base fields to configurable display settings.
AggregatorDisplayConfigurableTest::testItemDisplayConfigurable in core/modules/aggregator/tests/src/Functional/AggregatorDisplayConfigurableTest.php
Tests item base fields settings.
BlockUiTest::testBrokenBlockVisibility in core/modules/block/tests/src/Functional/BlockUiTest.php
Tests that users without permission are not able to view broken blocks.
BooleanFormatterSettingsTest::testBooleanFormatterSettings in core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
Tests the formatter settings page for the Boolean formatter.

... See full list

1 method overrides UiHelperTrait::assertSession()
WebDriverTestBase::assertSession in core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
Returns WebAssert object.

File

core/tests/Drupal/Tests/UiHelperTrait.php, line 297

Class

UiHelperTrait
Provides UI helper methods.

Namespace

Drupal\Tests

Code

public function assertSession($name = NULL) {
    $this->addToAssertionCount(1);
    return new WebAssert($this->getSession($name), $this->baseUrl);
}

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