You are here

protected function WebformAssertLegacyTrait::assertField in Webform 6.x

Same name and namespace in other branches
  1. 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\Traits

Code

protected function assertField($field) {
  $this
    ->assertFieldByXPath($this
    ->constructFieldXpath('name', $field) . '|' . $this
    ->constructFieldXpath('id', $field));
}