You are here

protected function WebformAssertLegacyTrait::assertField in Webform 8.5

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

1 call to WebformAssertLegacyTrait::assertField()
WebformEntityTranslationTest::testTranslate in tests/src/Functional/WebformEntityTranslationTest.php
Tests webform translate.

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));
}