Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
Class for test-based fields. More...
Public Member Functions | |
get_attribute ($name) | |
Get the value of an attribute set on this field. | |
get_value () | |
Returns the current value of the element. | |
getSession ($name=null) | |
Returns the Mink session. | |
key_press ($char, $modifier=null) | |
Presses specific keyboard key. | |
matches ($expectedvalue) | |
Matches the provided value against the current field value. | |
set_value ($value) | |
Sets the value to a field. | |
Public Attributes | |
const | PAGE_READY_JS |
The JS code to check that the page is ready. | |
Protected Member Functions | |
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. | |
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. | |
Protected Attributes | |
NodeElement | $field |
The field DOM node to interact with. | |
string | $fieldlocator = false |
The field's locator. | |
Session | $session |
Behat session. | |
Class for test-based fields.
|
inherited |
Get the value of an attribute set on this field.
string | $name | The attribute name |
string | The attribute value |
|
protectedinherited |
Returns the appropriate form field object for a given node element.
NodeElement | $element | The node element |
behat_form_field |
|
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...).
coding_exception |
string | $locatortype |
string |
|
protectedinherited |
Gets the field internal id used by selenium wire protocol.
Only available when running_javascript().
coding_exception |
int |
behat_form_text::get_value | ( | ) |
Returns the current value of the element.
string |
Reimplemented from behat_form_field.
Reimplemented in behat_form_editor.
|
inherited |
Returns the Mink session.
string | null | $name | name of the session OR active session will be used |
Behat\Mink\Session |
Implements behat_session_interface.
|
inherited |
Presses specific keyboard key.
mixed | $char | could be either char ('b') or char-code (98) |
string | $modifier | keyboard modifier (could be 'ctrl', 'alt', 'shift' or 'meta') |
behat_form_text::matches | ( | $expectedvalue | ) |
Matches the provided value against the current field value.
string | $expectedvalue |
bool | The provided value matches the field value? |
Reimplemented from behat_form_field.
Reimplemented in behat_form_editor.
|
protectedinherited |
Returns whether the scenario is running in a browser that can run Javascript or not.
bool |
behat_form_text::set_value | ( | $value | ) |
Sets the value to a field.
string | $value |
void |
Reimplemented from behat_form_field.
Reimplemented in behat_form_autocomplete, behat_form_availability, behat_form_editor, behat_form_inplaceeditable, and behat_form_passwordunmask.
|
protectedinherited |
Checks if the provided text matches the field value.
string | $expectedvalue | |
string | null | $actualvalue | The actual value. If not specified, this will be fetched from $this->get_value(). |
bool |
|
protectedinherited |
Waits for all the JS activity to be completed.
bool | Whether any JS is still pending completion. |
|
inherited |
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.