protected function WebformAssertLegacyTrait::assertField in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/src/Traits/WebformAssertLegacyTrait.php \Drupal\Tests\webform\Traits\WebformAssertLegacyTrait::assertField()
Asserts that a field exists with the given name or ID.
Parameters
string $field: Name or ID of field to assert.
File
- tests/
src/ Traits/ WebformAssertLegacyTrait.php, line 285
Class
- WebformAssertLegacyTrait
- Provides convenience methods for assertions in browser tests.
Namespace
Drupal\Tests\webform\TraitsCode
protected function assertField($field) {
$this
->assertFieldByXPath($this
->constructFieldXpath('name', $field) . '|' . $this
->constructFieldXpath('id', $field));
}