class

Marionette::ActionBuilder

Inherits Reference / Object

ActionBuilder allows you to put together a custom sequence of actions to be performed in the given order. These actions can include clicks, pointer moves, and keyboard actions.

The easiest way to use ActionBuilder is through Session#actions and Session#perform_actions.

Constants

DEBUG_MOUSE_MOVE_SCRIPT = {{ read_file("/tmp/tmp.LPdOiH/src/src/marionette/scripts/debug_mouse_move.js") }}

Constructors

new(session : Session, w3c_key_actions : Array(Marionette::Action) = [] of Action, w3c_pointer_actions : Array(Marionette::Action) = [] of Action, actions : Array(Tuple(String, Marionette::Action)) = [] of Tuple(String, Action))
Source

Instance methods

action(command : String, action : Action)

Add a non-W3C compatible action.

Source
actions
Source
clear_actions
Source
click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
click(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
click(button : MouseButton = :left)
Source
click(element : Element, button : MouseButton = :left)
Source
click_and_hold(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
click_and_hold(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
click_and_hold(button : MouseButton = :left)
Source
click_and_hold(element : Element, button : MouseButton = :left)
Source
create_key_down(key : Key | Char | String)

Create a new KeyDown action with the given value

Source
create_key_up(key : Key | Char | String)

Create a new KeyUp action with the given value

Source
create_mouse_down(button : MouseButton, duration : Time::Span = 0.seconds)

Create a new PointerDown action for the given button with the given click duration.

Source
create_mouse_up(button : MouseButton, duration : Time::Span = 0.seconds)

Create a new PointerUp action for the given button with the given click duration.

Source
create_pointer_move(x : Number, y : Number, duration : Time::Span = 0.seconds, origin = Origin::ViewPort.new)
Source
create_pointer_move(x : Number, y : Number, selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
Source
create_pointer_move(x : Number, y : Number, element : Element, duration : Time::Span = 0.seconds)
Source
create_pointer_move(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
Source
create_pointer_move(element : Element, duration : Time::Span = 0.seconds)
Source
double_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
double_click(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
double_click(button : MouseButton = :left)
Source
double_click(element : Element, button : MouseButton = :left)
Source
double_right_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
double_right_click(selector : String, location_strategy : LocationStrategy = :css)
Source
double_right_click(element : Element)
Source
double_right_click
Source
drag_and_drop(source : String, dest : String, location_strategy : LocationStrategy = :css)
Source
drag_and_drop(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Source
drag_and_drop(source : Element, delta_x : Number, delta_y : Number)
Source
drag_and_drop(source : Element, dest : Element)
Source
key_down(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css)
Source
key_down(key : Key | Char, element : Element)
Source
key_down(key : Key | Char)
Source
key_up(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css)
Source
key_up(key : Key | Char)
Source
mouse_button_down(button : MouseButton = :left, duration : Time::Span = 0.seconds)

Create a mouse down action and add it dependant on the W3C status of the current WebDriver.

Source
mouse_button_up(button : MouseButton = :left, duration : Time::Span = 0.seconds)

Create a mouse up action and add it dependant on the W3C status of the current WebDriver.

Source
move_mouse(x : Number, y : Number, duration : Time::Span = 0.seconds, origin = Origin::ViewPort.new)
Source
move_mouse_by(delta_x : Number, delta_y : Number, duration : Time::Span)
Source
move_mouse_by(delta_x : Number, delta_y : Number)
Source
move_mouse_to(x : Number, y : Number, duration : Time::Span = 0.seconds)
Source
move_mouse_to(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Source
move_mouse_to(element : Element, delta_x : Number, delta_y : Number)
Source
move_mouse_to(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
Source
move_mouse_to(element : Element, duration : Time::Span = 0.seconds)
Source
move_mouse_to(selector : String, location_strategy : LocationStrategy = :css)
Source
pause(duration : Time::Span = 0.seconds)
Source
perform(debug_mouse_move = false)
Source
release(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
release(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Source
release(button : MouseButton = :left)
Source
release_right(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Source
release_right(selector : String, location_strategy : LocationStrategy = :css)
Source
release_right
Source
reset_actions
Source
right_click(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Source
right_click(selector : String, location_strategy : LocationStrategy = :css)
Source
right_click(element : Element)
Source
right_click
Source
right_click_and_hold(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Source
right_click_and_hold(selector : String, location_strategy : LocationStrategy = :css)
Source
right_click_and_hold(element : Element)
Source
right_click_and_hold
Source
send_keys(selector : String, keys : Array(Key | Char | String))
Source
send_keys(element : Element, keys : Array(Key | Char | String))
Source
send_keys(keys : Array(Key | Char | String))
Source
session
Source
w3c_action(action : Action)

Add a new W3C compatible action and add a pause of the opposite type to keep ticks aligned.

Source
w3c_key_actions
Source
w3c_pointer_actions
Source