function AssertLegacyTrait::assertField
Same name in other branches
- 9 core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertField()
Asserts that a field exists with the given name or ID.
Parameters
string $field: Name or ID of field to assert.
Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->fieldExists() or $this->assertSession()->buttonExists() instead.
28 calls to AssertLegacyTrait::assertField()
- AreaTest::testUI in core/
modules/ views/ tests/ src/ Functional/ Handler/ AreaTest.php - Tests the generic UI of a area handler.
- BlockLanguageTest::testLanguageBlockVisibility in core/
modules/ block/ tests/ src/ Functional/ BlockLanguageTest.php - Tests the visibility settings for the blocks based on language.
- BlockLanguageTest::testMultipleLanguageTypes in core/
modules/ block/ tests/ src/ Functional/ BlockLanguageTest.php - Tests block language visibility with different language types.
- BlockUiTest::testBlockAdminUiPage in core/
modules/ block/ tests/ src/ Functional/ BlockUiTest.php - Test block admin page exists and functions correctly.
- BrowserTestBaseTest::testFieldAssertsForTextfields in core/
tests/ Drupal/ FunctionalTests/ BrowserTestBaseTest.php - Tests legacy field asserts using textfields.
File
-
core/
tests/ Drupal/ FunctionalTests/ AssertLegacyTrait.php, line 285
Class
- AssertLegacyTrait
- Provides convenience methods for assertions in browser tests.
Namespace
Drupal\FunctionalTestsCode
protected function assertField($field) {
$this->assertFieldByXPath($this->constructFieldXpath('name', $field) . '|' . $this->constructFieldXpath('id', $field));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.