You are here

public function WebAssert::fieldExists in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/WebAssert.php \Behat\Mink\WebAssert::fieldExists()

Checks that specific field exists on the current page.

Parameters

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

TraversableElement $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 632

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

public function fieldExists($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;
}