Behat\Mink


Behat\Mink\Element\TraversableElement
Behat/Mink/Element/TraversableElement.php at line 20

Class TraversableElement

Element
└─TraversableElement
All Known Subclasses:
DocumentElement NodeElement

public abstract class TraversableElement
extends Element

Traversable element.

Author:
Konstantin Kudryashov

Method Summary
NodeElement|null

findById(string id)

Finds element by it's id.

Boolean

hasLink(string locator)

Checks whether document has a link with specified locator.

NodeElement|null

findLink(string locator)

Finds link with specified locator.

void

clickLink(string locator)

Clicks link with specified locator.

Boolean

hasButton(string locator)

Checks whether document has a button (input[type=submit|image|button], button) with specified locator.

boolean

hasClass(string className)

Checks whether an element has a named CSS class

NodeElement|null

findButton(string locator)

Finds button (input[type=submit|image|button], button) with specified locator.

void

pressButton(string locator)

Presses button (input[type=submit|image|button], button) with specified locator.

Boolean

hasField(string locator)

Checks whether document has a field (input, textarea, select) with specified locator.

NodeElement|null

findField(string locator)

Finds field (input, textarea, select) with specified locator.

void

fillField(string locator, string value)

Fills in field (input, textarea, select) with specified locator.

Boolean

hasCheckedField(string locator)

Checks whether document has a checkbox with specified locator, which is checked.

Boolean

hasUncheckedField(string locator)

Checks whether document has a checkbox with specified locator, which is unchecked.

void

checkField(string locator)

Checks checkbox with specified locator.

void

uncheckField(string locator)

Unchecks checkbox with specified locator.

Boolean

hasSelect(string locator)

Checks whether document has a select field with specified locator.

void

selectFieldOption(string locator, string value, Boolean multiple)

Selects option from select field with specified locator.

Boolean

hasTable(string locator)

Checks whether document has a table with specified locator.

void

attachFileToField(string locator, string path)

Attach file to file field with specified locator.

Methods inherited from Behat\Mink\Element\Element
__construct, find, findAll, getHtml, getSession, getText, has

Method Detail

Behat/Mink/Element/TraversableElement.php at line 29

findById

public NodeElement|null findById(string id)

Finds element by it's id.

Parameters:
id - element id

Behat/Mink/Element/TraversableElement.php at line 43

hasLink

public Boolean hasLink(string locator)

Checks whether document has a link with specified locator.

Parameters:
locator - link id, title, text or image alt

Behat/Mink/Element/TraversableElement.php at line 55

findLink

public NodeElement|null findLink(string locator)

Finds link with specified locator.

Parameters:
locator - link id, title, text or image alt

Behat/Mink/Element/TraversableElement.php at line 69

clickLink

public void clickLink(string locator)

Clicks link with specified locator.

Parameters:
locator - link id, title, text or image alt
Throws:
ElementNotFoundException

Behat/Mink/Element/TraversableElement.php at line 89

hasButton

public Boolean hasButton(string locator)

Checks whether document has a button (input[type=submit|image|button], button) with specified locator.

Parameters:
locator - button id, value or alt

Behat/Mink/Element/TraversableElement.php at line 101

hasClass

public boolean hasClass(string className)

Checks whether an element has a named CSS class

Parameters:
className - Name of the class

Behat/Mink/Element/TraversableElement.php at line 117

findButton

public NodeElement|null findButton(string locator)

Finds button (input[type=submit|image|button], button) with specified locator.

Parameters:
locator - button id, value or alt

Behat/Mink/Element/TraversableElement.php at line 131

pressButton

public void pressButton(string locator)

Presses button (input[type=submit|image|button], button) with specified locator.

Parameters:
locator - button id, value or alt
Throws:
ElementNotFoundException

Behat/Mink/Element/TraversableElement.php at line 151

hasField

public Boolean hasField(string locator)

Checks whether document has a field (input, textarea, select) with specified locator.

Parameters:
locator - input id, name or label

Behat/Mink/Element/TraversableElement.php at line 163

findField

public NodeElement|null findField(string locator)

Finds field (input, textarea, select) with specified locator.

Parameters:
locator - input id, name or label

Behat/Mink/Element/TraversableElement.php at line 178

fillField

public void fillField(string locator, string value)

Fills in field (input, textarea, select) with specified locator.

Parameters:
locator - input id, name or label
value - value
Throws:
ElementNotFoundException

Behat/Mink/Element/TraversableElement.php at line 198

hasCheckedField

public Boolean hasCheckedField(string locator)

Checks whether document has a checkbox with specified locator, which is checked.

Parameters:
locator - input id, name or label

Behat/Mink/Element/TraversableElement.php at line 212

hasUncheckedField

public Boolean hasUncheckedField(string locator)

Checks whether document has a checkbox with specified locator, which is unchecked.

Parameters:
locator - input id, name or label

Behat/Mink/Element/TraversableElement.php at line 226

checkField

public void checkField(string locator)

Checks checkbox with specified locator.

Parameters:
locator - input id, name or label
Throws:
ElementNotFoundException

Behat/Mink/Element/TraversableElement.php at line 246

uncheckField

public void uncheckField(string locator)

Unchecks checkbox with specified locator.

Parameters:
locator - input id, name or label
Throws:
ElementNotFoundException

Behat/Mink/Element/TraversableElement.php at line 266

hasSelect

public Boolean hasSelect(string locator)

Checks whether document has a select field with specified locator.

Parameters:
locator - select id, name or label

Behat/Mink/Element/TraversableElement.php at line 282

selectFieldOption

public void selectFieldOption(string locator, string value, Boolean multiple)

Selects option from select field with specified locator.

Parameters:
locator - input id, name or label
value - option value
multiple - select multiple options
Throws:
ElementNotFoundException

Behat/Mink/Element/TraversableElement.php at line 302

hasTable

public Boolean hasTable(string locator)

Checks whether document has a table with specified locator.

Parameters:
locator - table id or caption

Behat/Mink/Element/TraversableElement.php at line 317

attachFileToField

public void attachFileToField(string locator, string path)

Attach file to file field with specified locator.

Parameters:
locator - input id, name or label
path - path to file
Throws:
ElementNotFoundException

Behat\Mink