Form actions
fillField
Method allowing to fill a specific text element on a page. Clears the value before filling the field (if any value was available).
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted text element to fill. |
text | string /number | Content to put inside the targeted text element. |
options | object | Fill action options. |
options
Name | Type | Description |
---|---|---|
characterByCharacter | boolean | If true, the field is filled character by character. |
paste | boolean | If true, content will be entirely pasted inside the text element. |
speed | number | Filling speed when characterByCharacter option is enabled. |
speed option is similar to an interval between each character added. The default value is 10
(ms).
Basic Usage
with full options.
await I.fillField(
"mySelector",
"myContent",
{
characterByCharacter: true,
paste: false,
speed: 100
});
appendField
Method allowing to append text inside a specific text element on a page.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted text element to add content in. |
text | string /number | Content to put inside the targeted text element. |
options | object | Append field action options. |
options
Name | Type | Description |
---|---|---|
characterByCharacter | boolean | If true, the field is filled character by character. |
paste | boolean | If true, content will be entirely pasted inside the text element. |
speed | number | Filling speed when characterByCharacter option is enabled. |
replace | boolean | If true, the existing content inside the text element will be replaced by the text value. |
speed option is similar to an interval between each character added. The default value is 10
(ms).
Basic Usage
await I.appendField("mySelector",
"myContent",
{
characterByCharacter: true,
paste: false,
speed: 100,
replace: false
})
prependField
Method allowing to prepend text inside a specific text element on a page.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted text element to prepend content in. |
text | string /number | Content to put inside the targeted text element. |
options | object | Prepend field action options. |
options
Name | Type | Description |
---|---|---|
characterByCharacter | boolean | If true, the field is filled character by character. |
paste | boolean | If true, content will be entirely pasted inside the text element. |
speed | number | Filling speed when characterByCharacter option is enabled. |
replace | boolean | If true, the existing content inside the text element will be replaced by the text value. |
speed option is similar to an interval between each character added. The default value is 10
(ms).
Basic Usage
await I.prependField("mySelector",
"myContent",
{
characterByCharacter: true,
paste: false,
speed: 100,
replace: false
})
clearField
Method allowing to clear content inside a specific text element on a page.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted text element to clear content in. |
Basic Usage
await I.clearField("mySelector");
select
Method allowing to select content inside a specific text element on a page.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted text element to select content in. |
Basic Usage
await I.select("mySelector");
selectOption
Method allowing to select option of a dropdown element (there is no need to open the list with values before the action).
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted text element to select content in. |
option | string / number / string[] / number[] / object | Options allowing to select the element selected inside the dropdown. |
Basic Usage
string
await I.selectOption(
"mySelector",
"option a"
);
number
await I.selectOption(
"mySelector",
1
);
string[]
await I.selectOption(
"mySelector",
["option a"]
);
number[]
await I.selectOption(
"mySelector",
[1]
);
selectOption.option objects
Parameter | Type | Description |
---|---|---|
label | string / undefined | Inner text inside the targeted option. |
value | string / undefined | Value of the attribute value matching the targeted option. |
index | number / undefined | Index number of the targeted option |
Basic Usage
await I.selectOption(
"mySelector",
{
label:`optionText`,
value: `valueOfAttribute`
})
await I.selectOption(
"mySelector",
[ {
label:`optionText`,
value: `valueOfAttribute`
}
])
deselectOption
Method allowing to deselect option of a dropdown element.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted text element to deselect. |
option | string / number / string[] / number[] / object | Options allowing to deselect the element selected inside the dropdown. |
Basic Usage
string
await I.deselectOption(
"mySelector",
"option a"
);
number
await I.deselectOption(
"mySelector",
1
);
string[]
await I.deselectOption(
"mySelector",
["option a"]
);
number[]
await I.deselectOption(
"mySelector",
[1]
);
deselectOption.option objects
Parameter | Type | Description |
---|---|---|
label | string / undefined | Inner text inside the targeted option. |
value | string / undefined | Value of the attribute value matching the targeted option. |
index | number / undefined | Index number of the targeted option |
Basic Usage
await I.deselectOption(
"mySelector",
{
label:`optionText`,
})
await I.deselectOption(
"mySelector",
[ {
label:`optionText`,
}
])
checkOption
Method allowing to check a checkbox element.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted checkbox element to check. |
Basic Usage
await I.checkOption("mySelector");
uncheckOption
Method allowing to uncheck a checkbox element.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the the targeted checkbox element to uncheck. |
Basic Usage
await I.uncheckOption("mySelector");