◆ get_dom_elements_for_node()
static behat_field_manager::get_dom_elements_for_node |
( |
NodeElement |
$fieldnode, |
|
|
Session |
$session |
|
) |
| |
|
staticprotected |
Get the DOMDocument and DOMElement for a NodeElement.
- Parameters
-
NodeElement | $fieldnode | |
Session | $session | |
- Return values
-
◆ get_field()
static behat_field_manager::get_field |
( |
NodeElement |
$fieldnode, |
|
|
|
$locator, |
|
|
Session |
$session |
|
) |
| |
|
static |
Gets an instance of the form field.
Not all the fields are part of a moodle form, in this cases it fallsback to the generic form field. Also note that this generic field type is using a generic setValue() method from the Behat API, which is not always good to set the value of form elements.
- Deprecated:
- since Moodle 2.6 MDL-39634 - please do not use this function any more.
- Todo:
- MDL-XXXXX This will be deleted in Moodle 2.8
- See also
- behat_field_manager::get_form_field()
- Parameters
-
NodeElement | $fieldnode | |
string | $locator | |
Session | $session | The behat browser session |
- Return values
-
◆ get_field_instance()
static behat_field_manager::get_field_instance |
( |
|
$type, |
|
|
NodeElement |
$fieldnode, |
|
|
Session |
$session |
|
) |
| |
|
static |
Returns the appropiate behat_form_field according to the provided type.
It defaults to behat_form_field.
- Parameters
-
string | $type | The field type (checkbox, date_selector, text...) |
NodeElement | $fieldnode | |
Session | $session | The behat session |
- Return values
-
◆ get_field_node_type()
static behat_field_manager::get_field_node_type |
( |
NodeElement |
$fieldnode, |
|
|
Session |
$session |
|
) |
| |
|
staticprotected |
Recursive method to find the field type.
Depending on the field the felement class node is in a level or in another. We look recursively for a parent node with a 'felement' class to find the field type.
- Parameters
-
NodeElement | $fieldnode | The current node. |
Session | $session | The behat browser session |
- Return values
-
null|string | A text description of the node type, or null if one could not be accurately determined |
◆ get_field_type()
static behat_field_manager::get_field_type |
( |
\DOMDocument |
$document, |
|
|
DOMElement |
$node, |
|
|
Session |
$session |
|
) |
| |
|
staticprotected |
Get the field type from the specified DOMElement.
- Parameters
-
DOMDocument | $document | |
DOMElement | $node | |
Session | $session | |
- Return values
-
◆ get_form_field()
static behat_field_manager::get_form_field |
( |
NodeElement |
$fieldnode, |
|
|
Session |
$session |
|
) |
| |
|
static |
Gets an instance of the form field.
Not all the fields are part of a moodle form, in this cases it fallsback to the generic form field. Also note that this generic field type is using a generic setValue() method from the Behat API, which is not always good to set the value of form elements.
- Parameters
-
NodeElement | $fieldnode | |
Session | $session | The behat browser session |
- Return values
-
◆ get_form_field_from_label()
static behat_field_manager::get_form_field_from_label |
( |
|
$label, |
|
|
RawMinkContext |
$context |
|
) |
| |
|
static |
Gets an instance of the form field from it's label.
- Parameters
-
string | $label | |
RawMinkContext | $context | |
- Return values
-
◆ get_node_type()
static behat_field_manager::get_node_type |
( |
NodeElement |
$fieldnode, |
|
|
|
$locator, |
|
|
Session |
$session |
|
) |
| |
|
staticprotected |
Recursive method to find the field type.
Depending on the field the felement class node is in a level or in another. We look recursively for a parent node with a 'felement' class to find the field type.
- Deprecated:
- since Moodle 2.6 MDL-39634 - please do not use this function any more.
- Todo:
- MDL-XXXXX This will be deleted in Moodle 2.8
- See also
- behat_field_manager::get_field_node_type()
- Parameters
-
NodeElement | $fieldnode | The current node. |
string | $locator | |
Session | $session | The behat browser session |
- Return values
-
mixed | A NodeElement if we continue looking for the element type and String or false when we are done. |
◆ guess_field_type()
static behat_field_manager::guess_field_type |
( |
NodeElement |
$fieldnode, |
|
|
Session |
$session |
|
) |
| |
|
static |
Guesses a basic field type and returns it.
This method is intended to detect HTML form fields when no moodleform-specific elements have been detected.
- Parameters
-
NodeElement | $fieldnode | |
Session | $session | |
- Return values
-
string|bool | The field type or false. |
◆ is_moodleform_field()
static behat_field_manager::is_moodleform_field |
( |
NodeElement |
$fieldnode | ) |
|
|
staticprotected |
Detects when the field is a moodleform field type.
Note that there are fields inside moodleforms that are not moodleform element; this method can not detect this, this will be managed by get_field_node_type, after failing to find the form element element type.
- Parameters
-
- Return values
-
◆ normalise_fieldtype()
static behat_field_manager::normalise_fieldtype |
( |
string |
$fieldtype | ) |
|
|
staticprotected |
Normalise the field type.
- Parameters
-
- Return values
-
The documentation for this class was generated from the following file: