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))
SourceInstance methods
actions
Sourceclear_actions
Sourceclick(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourceclick(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourceclick(button : MouseButton = :left)
Sourceclick(element : Element, button : MouseButton = :left)
Sourceclick_and_hold(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourceclick_and_hold(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourceclick_and_hold(button : MouseButton = :left)
Sourceclick_and_hold(element : Element, button : MouseButton = :left)
Sourcecreate_mouse_down(button : MouseButton, duration : Time::Span = 0.seconds)
Create a new PointerDown action for the given button with the
given click duration.
create_mouse_up(button : MouseButton, duration : Time::Span = 0.seconds)
Create a new PointerUp action for the given button with the
given click duration.
create_pointer_move(x : Number, y : Number, duration : Time::Span = 0.seconds, origin = Origin::ViewPort.new)
Sourcecreate_pointer_move(x : Number, y : Number, selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
Sourcecreate_pointer_move(x : Number, y : Number, element : Element, duration : Time::Span = 0.seconds)
Sourcecreate_pointer_move(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
Sourcecreate_pointer_move(element : Element, duration : Time::Span = 0.seconds)
Sourcedouble_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourcedouble_click(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourcedouble_click(button : MouseButton = :left)
Sourcedouble_click(element : Element, button : MouseButton = :left)
Sourcedouble_right_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourcedouble_right_click(selector : String, location_strategy : LocationStrategy = :css)
Sourcedouble_right_click(element : Element)
Sourcedouble_right_click
Sourcedrag_and_drop(source : String, dest : String, location_strategy : LocationStrategy = :css)
Sourcedrag_and_drop(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Sourcedrag_and_drop(source : Element, delta_x : Number, delta_y : Number)
Sourcedrag_and_drop(source : Element, dest : Element)
Sourcekey_down(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css)
Sourcekey_down(key : Key | Char, element : Element)
Sourcekey_down(key : Key | Char)
Sourcekey_up(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css)
Sourcekey_up(key : Key | Char)
Sourcemouse_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.
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.
move_mouse(x : Number, y : Number, duration : Time::Span = 0.seconds, origin = Origin::ViewPort.new)
Sourcemove_mouse_by(delta_x : Number, delta_y : Number, duration : Time::Span)
Sourcemove_mouse_by(delta_x : Number, delta_y : Number)
Sourcemove_mouse_to(x : Number, y : Number, duration : Time::Span = 0.seconds)
Sourcemove_mouse_to(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Sourcemove_mouse_to(element : Element, delta_x : Number, delta_y : Number)
Sourcemove_mouse_to(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
Sourcemove_mouse_to(element : Element, duration : Time::Span = 0.seconds)
Sourcemove_mouse_to(selector : String, location_strategy : LocationStrategy = :css)
Sourcepause(duration : Time::Span = 0.seconds)
Sourceperform(debug_mouse_move = false)
Sourcerelease(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourcerelease(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
Sourcerelease(button : MouseButton = :left)
Sourcerelease_right(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Sourcerelease_right(selector : String, location_strategy : LocationStrategy = :css)
Sourcerelease_right
Sourcereset_actions
Sourceright_click(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Sourceright_click(selector : String, location_strategy : LocationStrategy = :css)
Sourceright_click(element : Element)
Sourceright_click
Sourceright_click_and_hold(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
Sourceright_click_and_hold(selector : String, location_strategy : LocationStrategy = :css)
Sourceright_click_and_hold(element : Element)
Sourceright_click_and_hold
Sourcesend_keys(selector : String, keys : Array(Key | Char | String))
Sourcesend_keys(element : Element, keys : Array(Key | Char | String))
Sourcesend_keys(keys : Array(Key | Char | String))
Sourcesession
Sourcew3c_action(action : Action)
Add a new W3C compatible action and add a pause of the opposite type to keep ticks aligned.
w3c_key_actions
Sourcew3c_pointer_actions
Source