Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. WebAssert.php

function WebAssert::fieldExists

Checks that specific field exists on the current page.

Parameters

string $field field id|name|label|value:

TraversableElement|null $container document to check against:

Return value

NodeElement

Throws

ElementNotFoundException

4 calls to WebAssert::fieldExists()
WebAssert::checkboxChecked in vendor/behat/mink/src/WebAssert.php
Checks that specific checkbox is checked.
WebAssert::checkboxNotChecked in vendor/behat/mink/src/WebAssert.php
Checks that specific checkbox is unchecked.
WebAssert::fieldValueEquals in vendor/behat/mink/src/WebAssert.php
Checks that specific field have provided value.
WebAssert::fieldValueNotEquals in vendor/behat/mink/src/WebAssert.php
Checks that specific field have provided value.

File

vendor/behat/mink/src/WebAssert.php, line 725

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function fieldExists(string $field, ?TraversableElement $container = null) {
    $container = $container ?: $this->session
        ->getPage();
    $node = $container->findField($field);
    if (null === $node) {
        throw new ElementNotFoundException($this->session
            ->getDriver(), 'form field', 'id|name|label|value', $field);
    }
    return $node;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal