Mouse actions
click
Method allowing to perform a click action.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the element to click. |
option | object | Click action options. |
options
Parameter | Type | Description |
---|---|---|
modifiers | KeyModifiers / undefined | Key to press whilst performing a click. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while performing a click. |
Control | boolean / undefined | If true, Control key is press while performing a click. |
Meta | boolean / undefined | If true, Meta key is press while performing a click. |
Shift | boolean / undefined | If true, Shift key is press while performing a click. |
Basic Usage
await I.click(
"mySelector",
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
);
doubleClick
Method allowing to perform a double click action.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the element to double-click. |
option | object | Double-click action options. |
options
Parameter | Type | Description |
---|---|---|
modifiers | KeyModifiers / undefined | Key to press whilst performing a doubleclick. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while performing a double click. |
Control | boolean / undefined | If true, Control key is press while performing a double click. |
Meta | boolean / undefined | If true, Meta key is press while performing a double click. |
Shift | boolean / undefined | If true, Shift key is press while performing a double click. |
Basic Usage
await I.doubleclick(
"mySelector",
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
);
middleClick
Method allowing to perform a middle-click action.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the element to middle-click. |
option | object | Middle click action options. |
options
Parameter | Type | Description |
---|---|---|
modifiers | KeyModifiers / undefined | Key to press whilst performing a middle click. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while performing a middle click. |
Control | boolean / undefined | If true, Control key is press while performing a middle click. |
Meta | boolean / undefined | If true, Meta key is press while performing a middle click. |
Shift | boolean / undefined | If true, Shift key is press while performing a middle click. |
Basic Usage
await I.middleClick(
"mySelector",
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
);
rightClick
Method allowing to perform a right-click action.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the element to right-click. |
option | object | Right click action options. |
options
Parameter | Type | Description |
---|---|---|
modifiers | KeyModifiers / undefined | Key to press whilst performing a right click. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while performing a right click. |
Control | boolean / undefined | If true, Control key is press while performing a right click. |
Meta | boolean / undefined | If true, Meta key is press while performing a right click. |
Shift | boolean / undefined | If true, Shift key is press while performing a right click. |
Basic Usage
await I.rightClick(
"mySelector",
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
);
hover
Method allowing to hover over an element with the mouse cursor.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the element to hover. |
option | object | Hover action options. |
options
Parameter | Type | Description |
---|---|---|
modifiers | KeyModifiers / undefined | Key to press whilst hovering. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while hovering. |
Control | boolean / undefined | If true, Control key is press while hovering. |
Meta | boolean / undefined | If true, Meta key is press while hovering. |
Shift | boolean / undefined | If true, Shift key is press while hovering. |
Basic Usage
await I.hover(
"mySelector",
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
);
mouseUp
Method allowing to stop pressing a mouse button.
Parameter | Type | Description |
---|---|---|
option | object | Mouse up action options. |
options
Parameter | Type | Description |
---|---|---|
button | left / middle / right | Mouse buttons to release. |
modifiers | KeyModifiers / undefined | Key to press while releasing mouse buttons. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while hovering. |
Control | boolean / undefined | If true, Control key is press while hovering. |
Meta | boolean / undefined | If true, Meta key is press while hovering. |
Shift | boolean / undefined | If true, Shift key is press while hovering. |
Basic Usage
await I.mouseUp(); //Stop pressing all mouse buttons.
await I.mouseUp({
button: `left`,
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
});
mouseDown
Method allowing to keep pressing a mouse button.
Parameter | Type | Description |
---|---|---|
option | object | Mouse down action options. |
options
Parameter | Type | Description |
---|---|---|
x | number | Abscissa of the aimed cursor position. |
y | number | Ordinate of the aimed cursor position. |
button | left / middle / right | Mouse buttons to press. |
modifiers | KeyModifiers / undefined | Key to press while pressing mouse buttons. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while hovering. |
Control | boolean / undefined | If true, Control key is press while hovering. |
Meta | boolean / undefined | If true, Meta key is press while hovering. |
Shift | boolean / undefined | If true, Shift key is press while hovering. |
Basic Usage
await I.mouseDown({
x :100,
y:100,
button: `left`,
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
});
mouseMove
Method allowing to move the mouse cursor.
Parameter | Type | Description |
---|---|---|
x | number | Horizontal mouse pointer coordinates that define the aimed position. |
y | number | Horizontal mouse pointer coordinates that define the aimed position. |
option | object | Mouse move action options. |
options
Parameter | Type | Description |
---|---|---|
button | left / middle / right | Mouse buttons to press. |
modifiers | KeyModifiers / undefined | Key to press while moving the mouse cursor. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while hovering. |
Control | boolean / undefined | If true, Control key is press while hovering. |
Meta | boolean / undefined | If true, Meta key is press while hovering. |
Shift | boolean / undefined | If true, Shift key is press while hovering. |
Basic Usage
await I.mouseMove(
x:100,
y:100,
{
modifiers:{
Alt:false,
Control:false,
Meta:false,
Shift:false
}
}
);
drag
Method allowing to drag an element to a specific position.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the element to drag. |
dragOffsetX | number | Horizontal mouse pointer coordinates that define a point where the action is performed. |
dragOffsetY | number | Vertical mouse pointer coordinates that define a point where the action is performed. |
options | DragToSelectorOptions | Dragging action options. |
options
Parameter | Type | Description |
---|---|---|
destinationOffsetX | number | Horizontal mouse pointer coordinates that define a point where the action is stopped. |
destinationOffsetY | number | Vertical mouse pointer coordinates that define a point where the action is stopped. |
offsetX | number | Horizontal mouse pointer coordinates that define a point where the action is started. |
offsetY | number | Vertical mouse pointer coordinates that define a point where the action is started. |
modifiers | KeyModifiers / undefined | Key to press while performing the action. |
speed | number | Value defining the execution speed of the action. |
KeyModifiers
Parameter | Type | Description |
---|---|---|
Alt | boolean / undefined | If true, Alt key is press while hovering. |
Control | boolean / undefined | If true, Control key is press while hovering. |
Meta | boolean / undefined | If true, Meta key is press while hovering. |
Shift | boolean / undefined | If true, Shift key is press while hovering. |
Basic Usage
await I.drag(
"mySelector",
100,
100,
{
destinationOffsetX: 10,
destinationOffsetY: 10,
modifiers :{
Alt:false,
Control:false,
Meta: false,
Shift: false
},
offsetX: 10,
offsetY: 10,
speed:15
}
);
dragToSelector
Method allowing to drag an element to another specific element.
Parameter | Type | Description |
---|---|---|
selector | selectorType | Selector of the element to drag. |
destinationSelector | selectorType | Selector of the destination element of the dragging action. |
options | DragToSelectorOptions | Dragging action options. |
options
Parameter | Type | Description |
---|---|---|
destinationOffsetX | number | Horizontal mouse pointer coordinates that define a point where the action is stopped. |
destinationOffsetY | number | Vertical mouse pointer coordinates that define a point where the action is stopped. |
offsetX | number | Horizontal mouse pointer coordinates that define a point where the action is started. |
offsetY | number | Vertical mouse pointer coordinates that define a point where the action is started. |
modifiers | KeyModifiers / undefined | Key to press while performing the action. |
speed | number | Value defining the execution speed of the action. |
moveCursorToSelector
Method allowing to move the mouse cursor to a specific element.
Parameter | Type | Description |
---|---|---|
selector | number | Selector of the element to move the mouse cursor to. |
offsetX | number | Horizontal mouse pointer coordinates that define a point where the action is performed. |
offsetY | number | Vertical mouse pointer coordinates that define a point where the action is performed. |