Skip to content

How to use input fields

Natalia Firstova edited this page Mar 2, 2020 · 35 revisions

CheckBox

CheckBox

Use the checked attribute to set the value of the CheckBox to true:

$c(CheckBox, byCubaId(<cubaId>)).checked = true;

In order to check that the value of the CheckBox is set to true use the special CHECKED condition:

$c(CheckBox, byCubaId(<cubaId>)).shouldBe(CHECKED);

All the standard conditions except the REQUIRED are also available. Note that there are two special conditions for the CheckBox component: CHECKED and SELECTED.

See the documentation

TextField

CheckBox

Use the value attribute to set the value to the TextField

$c(TextField, byCubaId(<cubaId>)).value = "value";

In order to check the values of the TextField use the special Conditions.value condition:

$c(TextField, byCubaId(<cubaId>)).shouldHave(Conditions.value("value"));

All the standard conditions are also available.

See the documentation

DateField

CheckBox

Use the setDateValue() method to set the value to the DateField. The value passed to the method depends on the locale used in the application. For example, if the date has the following format DDMMYYYY, the value should be passed as it is given below:

$c(DateField, byCubaId(<cubaId>)).setDateValue(<DDMMYYYY>);

In order to check the values of the DateField use the special Conditions.value condition. The value passed to the method must have the format used in your system:

$c(DateField, byCubaId(<cubaId>)).shouldHave(Conditions.value("23032018"));

All the standard conditions are also available.

See the documentation

DateTimeField

CheckBox

Use the setDateValue() and setTimeValue() methods to set the value to the DateTimeField. The value passed to the method depends on the locale that used in the application. For example, if the date has the format DDMMYYYY and the time has the format hhmm, the value should be passed as it is given below:

$c(DateTimeField, byCubaId(<cubaId>)).setDateValue(<DDMMYYYY>).setTimeValue(<hhmm>);

In order to check the values of the DateTimeField use the special Conditions.value condition. The value passed to the method must have the following format: DDMMYYYY:

$c(DateTimeField, byCubaId(<cubaId>)).shouldHave(Conditions.value(<DDMMYYYY>));

All the standard conditions are also available.

See the documentation

LookupField

CheckBox

There are two ways to set the value in the LookupField component. The first way is to use setValue() method:

$c(LookupField, byCubaId(<cubaId>)).setValue(<value>);

Another way is to filter the drop-down list and select the required value from the filtered list:

$c(LookupField, <cubaId>).setFilter(<filter_value>).getOptionsPopup().select("value");

Sometimes we need to check if the drop-down list contains the required values. To do so use the special visibleOptions condition:

$c(LookupField, <cubaId>).openOptionsPopup().shouldHave(visibleOptions("value"));

If the popup option contains a lot of values and the necessary values are not displayed on the first page, it is useful to filter the values first:

$c(LookupField, <cubaId>).setFilter("filter_value").getOptionsPopup().shouldHave(visibleOptions("value"));

See the documentation

PickerField

CheckBox

Click the lookup button to set the value to the PickerField:

$c(PickerField, byCubaId(<cubaId>)).triggerAction(HasActions.OPEN);

This action will open the Lookup screen of the Entity. Here you will be able to select the value from the table, then click the Select button and return to the PickerField component. The selected value will be set to the PickerField component.

In order to check the values of the PickerField use the special Conditions.value condition:

$c(PickerField, byCubaId(<cubaId>)).shouldHave(Conditions.value("value"));

All the standard conditions are also available:

$c(PickerField, byCubaId(<cubaId>)).shouldBe(Conditions.VISIBLE);

See the documentation

LookupPickerField

CheckBox

LookupPickerField component combines all options available in the PickerField and LookupField components.

See the documentation