Date form field.
More...
|
| get_attribute ($name) |
| Get the value of an attribute set on this field.
|
|
| get_value () |
| Returns the current value of the select element.
|
|
| getSession ($name=null) |
| Returns the Mink session.
|
|
| key_press ($char, $modifier=null) |
| Presses specific keyboard key.
|
|
| matches ($expectedvalue) |
| Generic match implementation.
|
|
| set_value ($value) |
| Sets the value to a date field.
|
|
|
| get_field_instance_for_element (NodeElement $element) |
| Returns the appropriate form field object for a given node element.
|
|
| get_field_locator ($locatortype=false) |
| Gets the field locator.
|
|
| get_internal_field_id () |
| Gets the field internal id used by selenium wire protocol.
|
|
| get_mapped_fields (int $timestamp) |
| Returns the date field identifiers and the values that should be assigned to them.
|
|
| running_javascript () |
| Returns whether the scenario is running in a browser that can run Javascript or not.
|
|
| text_matches ($expectedvalue, ?string $actualvalue=null) |
| Checks if the provided text matches the field value.
|
|
| wait_for_pending_js () |
| Waits for all the JS activity to be completed.
|
|
|
NodeElement | $field |
| The field DOM node to interact with.
|
|
string | $fieldlocator = false |
| The field's locator.
|
|
Session | $session |
| Behat session.
|
|
Date form field.
This class will be refactored in case we are interested in creating more complex formats to fill date and date-time fields.
- Copyright
- 2013 David MonllaĆ³
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_attribute()
behat_form_field::get_attribute |
( |
| $name | ) |
|
|
inherited |
Get the value of an attribute set on this field.
- Parameters
-
string | $name | The attribute name |
- Return values
-
string | The attribute value |
◆ get_field_instance_for_element()
behat_form_field::get_field_instance_for_element |
( |
NodeElement | $element | ) |
|
|
protectedinherited |
Returns the appropriate form field object for a given node element.
- Parameters
-
NodeElement | $element | The node element |
- Return values
-
◆ get_field_locator()
behat_form_field::get_field_locator |
( |
| $locatortype = false | ) |
|
|
protectedinherited |
Gets the field locator.
Defaults to the field label but you can specify other locators if you are interested.
Public visibility as in most cases will be hard to use this method in a generic way, as fields can be selected using multiple ways (label, id, name...).
- Exceptions
-
- Parameters
-
- Return values
-
◆ get_internal_field_id()
behat_form_field::get_internal_field_id |
( |
| ) |
|
|
protectedinherited |
Gets the field internal id used by selenium wire protocol.
Only available when running_javascript().
- Exceptions
-
- Return values
-
◆ get_mapped_fields()
behat_form_date::get_mapped_fields |
( |
int | $timestamp | ) |
|
|
protected |
Returns the date field identifiers and the values that should be assigned to them.
- Parameters
-
int | $timestamp | The UNIX timestamp |
- Return values
-
Reimplemented in behat_form_date_time.
◆ get_value()
behat_form_field::get_value |
( |
| ) |
|
|
inherited |
◆ getSession()
behat_form_field::getSession |
( |
| $name = null | ) |
|
|
inherited |
Returns the Mink session.
- Parameters
-
string | null | $name | name of the session OR active session will be used |
- Return values
-
Implements behat_session_interface.
◆ key_press()
behat_form_field::key_press |
( |
| $char, |
|
|
| $modifier = null ) |
|
inherited |
Presses specific keyboard key.
- Parameters
-
mixed | $char | could be either char ('b') or char-code (98) |
string | $modifier | keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') |
◆ matches()
behat_form_field::matches |
( |
| $expectedvalue | ) |
|
|
inherited |
◆ running_javascript()
behat_form_field::running_javascript |
( |
| ) |
|
|
protectedinherited |
Returns whether the scenario is running in a browser that can run Javascript or not.
- Return values
-
◆ set_value()
behat_form_date::set_value |
( |
| $value | ) |
|
Sets the value to a date field.
- Parameters
-
string | $value | The value to be assigned to the date selector field. The string value must be either parsable into a UNIX timestamp or equal to 'disabled' (if disabling the date selector). |
- Return values
-
- Exceptions
-
ExpectationException | If the value is invalid. |
Reimplemented from behat_form_field.
◆ text_matches()
behat_form_field::text_matches |
( |
| $expectedvalue, |
|
|
?string | $actualvalue = null ) |
|
protectedinherited |
Checks if the provided text matches the field value.
- Parameters
-
string | $expectedvalue | |
string | null | $actualvalue | The actual value. If not specified, this will be fetched from $this->get_value(). |
- Return values
-
◆ wait_for_pending_js()
behat_form_field::wait_for_pending_js |
( |
| ) |
|
|
protectedinherited |
Waits for all the JS activity to be completed.
- Return values
-
bool | Whether any JS is still pending completion. |
◆ PAGE_READY_JS
const behat_session_interface::PAGE_READY_JS |
|
inherited |
Initial value:= "document.readyState === 'complete' && " .
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)"
The JS code to check that the page is ready.
The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.
The documentation for this class was generated from the following file:
- lib/behat/form_field/behat_form_date.php