|
NodeElement | $field |
| The field DOM node to interact with.
|
|
string | $fieldlocator = false |
| The field's locator.
|
|
Session | $session |
| Behat session.
|
|
◆ 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_option_xpath()
behat_form_select::get_option_xpath |
( |
|
$option, |
|
|
|
$selectxpath |
|
) |
| |
|
protectedinherited |
Returns the opton XPath based on it's select xpath.
- Parameters
-
string | $option | |
string | $selectxpath | |
- Return values
-
◆ get_selected_options()
behat_form_select::get_selected_options |
( |
|
$returntexts = true | ) |
|
|
protectedinherited |
Returns the field selected values.
Externalized from the common behat_form_field API method get_value() as matches() needs to check against both values and texts.
- Parameters
-
bool | $returntexts | Returns the options texts or the options values. |
- Return values
-
◆ get_unescaped_options()
behat_form_select::get_unescaped_options |
( |
|
$value | ) |
|
|
protectedinherited |
Cleans the list of options and returns it as a string separating options with |||.
- Parameters
-
string | $value | The string containing the escaped options. |
- Return values
-
◆ get_value()
behat_form_select::get_value |
( |
| ) |
|
|
inherited |
Returns the text of the currently selected options.
- Return values
-
string | Comma separated if multiple options are selected. Commas in option texts escaped with backslash. |
Reimplemented from behat_form_field.
◆ 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_select::matches |
( |
|
$expectedvalue | ) |
|
|
inherited |
Returns whether the provided argument matches the current value.
- Parameters
-
- Return values
-
Reimplemented from behat_form_field.
◆ 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_inplaceeditable_select::set_value |
( |
|
$value | ) |
|
◆ text_matches()
behat_form_field::text_matches |
( |
|
$expectedvalue | ) |
|
|
protectedinherited |
Checks if the provided text matches the field value.
- Parameters
-
- 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. |
◆ EXTENDED_TIMEOUT
const behat_session_interface::EXTENDED_TIMEOUT = 10 |
|
inherited |
And extended timeout for specific cases.
- Deprecated:
- since Moodle 3.7 MDL-64979 - please use get_extended_timeout() instead
- Todo:
- MDL-64982 This will be deleted in Moodle 3.11
- See also
- behat_base::get_extended_timeout()
◆ 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.
◆ REDUCED_TIMEOUT
const behat_session_interface::REDUCED_TIMEOUT = 2 |
|
inherited |
Small timeout.
A reduced timeout for cases where self::TIMEOUT is too much and a simple $this->getSession()->getPage()->find() could not be enough.
- Deprecated:
- since Moodle 3.7 MDL-64979 - please use get_reduced_timeout() instead
- Todo:
- MDL-64982 This will be deleted in Moodle 3.11
- See also
- behat_base::get_reduced_timeout()
◆ TIMEOUT
const behat_session_interface::TIMEOUT = 6 |
|
inherited |
The timeout for each Behat step (load page, wait for an element to load...).
- Deprecated:
- since Moodle 3.7 MDL-64979 - please use get_timeout() instead
- Todo:
- MDL-64982 This will be deleted in Moodle 3.11
- See also
- behat_base::get_timeout()
The documentation for this class was generated from the following file: