Skip to content

How to use input fields

Natalia Firstova edited this page Apr 28, 2018 · 35 revisions

LookupField

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

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

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

_$(LookupField, <cubaId>).setFilter(<filter_value>)
                .getOptionsPopup()
                .select(<value>)

Sometimes it is needed to check, that the drop-down list contains the required values. To do so use the special visibleOptions condition:

_$(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:

_$(LookupField, <cubaId>).setFilter(<filter_value>)
                .getOptionsPopup()
                .shouldHave(visibleOptions(<value>))

PickerField

To set the value to the PickerField, click the lookup button:

_$(Button, 'lookup').click

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.

To check the values of the PickerField use the special Conditions.value condition:

_$(PickerField, byCubaId(<cubaId>))
                .shouldHave(Conditions.value(<value>)

All the standard conditions are also available:

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

TextField

To set the value to the TextField, use the value attribute

_$(TextField, byCubaId(<cubaId>))
              .value = 'value'

To check the values of the TextField use the special Conditions.value condition:

_$(TextField, byCubaId(<cubaId>))
              .shouldHave(Conditions.value(<value>)

All the standard conditions are also available.

DateField

To set the value to the DateField, use the setDateValue() method. The value passed to the method must have the following format: DDMMYYYY:

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

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

_$(TextField, byCubaId(<cubaId>))
                    .shouldHave(Conditions.value(<DDMMYYYY>)

All the standard conditions are also available.

DateTimeField

Clone this wiki locally