NAME
Kernel::Test::Role::Selenium::HandlesFormFields – role to interact with form fields in Selenium tests.
PUBLIC INTERFACE
has 'FormContainer'
holds a class name of the container (div) which wraps the form.
FormSelector()
Get x-path selector of fly out.
$Test->FormSelector(
FormContainer => 'AppointmentCreateFlyout' # optional div class, default attribute 'FormContainer'
);
FillFormEditor()
Sets values on a editor / rich text form field.
$Test->FillFormEditor(
Name => 'Body', # editor / rich text field name
Value => 'Lorem Ipsum doloret ...', # editor / rich text field value
FieldLabel => 'Body', # editor / rich text field label name
);
FillFormSelect()
Sets values on a select form field.
$Test->FillFormSelect(
Name => 'CalendarID', # select field name
Value => '4711', # select field value
FieldLabel => 'Calendar', # select field label name
OptionLabel => 'Holidays', # select field option value to set
);
For further parameters see "FormSelectValueSelect" in Kernel::Test::Selenium::Role::Driver::HandlesFormSelects.
FillFormTextArea()
Sets values on a text area form field.
$Test->FillFormTextArea(
Name => 'Description', # text area field name
Value => 'Lorem ipsum doloret ...', # text area field value to set
Clear => 0, # optional disable clear text area field, default enabled
Editor => 1, # optional, form field contains WYSIWYG editor, default none
);
FillFormInput()
Sets values on a text input form field.
$Test->FillFormInput(
Name => 'Location', # input field name
Value => 'Germany', # input field value to set
Clear => 0, # optional disable clear input field, default enabled
);
FillFormDateTime()
Sets values on a date time form field.
$Test->FillFormDateTime(
Name => 'StartTime', # date time field name
Value => '5/1/2021 - 00:00:00', # date time field value to set
CheckValue => '2021-5-1 00:00:00', # date time field check value
);
FillFormFields()
Sets values on a form field list.
$Test->FillFormFields(
Fields => [
{
Name => 'CalendarID',
Value => 4711,
Type => 'FormSelect',
FieldLabel => 'Calendar',
OptionLabel => 'Holidays',
},
{
Name => 'Location',
Value => 'Germany',
},
{
Name => 'StartTime',
Value => '5/1/2021 - 00:00:00',
CheckValue => '2021-5-1 00:00:00',
},
# ...
],
);
CheckFormEditor()
Test if editor / rich text form field is visible or not, also check its value if provided
$Test->CheckFormSelect(
Name => 'Body', # editor / rich text field name
Value => 'Lorem Ipsum doloret ...', # optional, editor / rich text field value to check
FieldLabel => 'Body', # editor / rich text field label
);
CheckFormDateTime()
Test if date time form field is visible or not, also check its value if provided
$Test->CheckFormDateTime(
Name => 'StartTime', # date time field name
CheckValue => '2021-5-1 00:00:00', # optional, date time value to check
FieldLabel => 'Start Date', # date time label
Visible => 1, # optional, date time field visibility, default 0
);
CheckFormSelect()
Test if select form field is visible or not, also check its value if provided
$Test->CheckFormSelect(
Name => 'CalendarID', # select field name
Value => '4711', # optional, select field value to check
FieldLabel => 'Calendar', # select field label
);
CheckFormTextArea()
Test if text area form field is visible or not, also check its value if provided
$Test->CheckFormTextArea(
Name => 'Description', # text area field name
Visible => 0, # optional, text area field visibility, default 0
);
CheckFormInput()
Test if text input form field is visible or not, also check its value if provided
$Test->CheckFormInput(
Name => 'Location', # input field name
Value => 'Germany', # optional, input field value to check
);
CheckFormFields()
Test if form fields are visible or not, also check its value if provided
$Test->CheckFormFields(
Fields [
{
Name => 'somename',
FieldLabel => 'somelabel,
Visible => 1,
Type => 'FormSelect',
Value => 'somevalue',
},
# ...
],
);