class Marionette::ActionBuilder
- Marionette::ActionBuilder
- Reference
- Object
Overview
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
.
Defined in:
Constant Summary
-
DEBUG_MOUSE_MOVE_SCRIPT =
{{ read_file("/home/watzon/Projects/personal/marionette/src/marionette/scripts/debug_mouse_move.js") }}
Constructors
Instance Method Summary
-
#action(command : String, action : Action)
Add a non-W3C compatible action.
- #actions : Array(Tuple(String, Action))
- #clear_actions
- #click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #click(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #click(button : MouseButton = :left)
- #click(element : Element, button : MouseButton = :left)
- #click_and_hold(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #click_and_hold(button : MouseButton = :left)
- #click_and_hold(element : Element, button : MouseButton = :left)
- #click_and_hold(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
-
#create_key_down(key : Key | Char | String)
Create a new
KeyDown
action with the given value -
#create_key_up(key : Key | Char | String)
Create a new
KeyUp
action with the given value -
#create_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)
- #create_pointer_move(x : Number, y : Number, element : Element, duration : Time::Span = 0.seconds)
- #create_pointer_move(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
- #create_pointer_move(element : Element, duration : Time::Span = 0.seconds)
- #create_pointer_move(x : Number, y : Number, selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
- #double_click(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #double_click(button : MouseButton = :left)
- #double_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #double_click(element : Element, button : MouseButton = :left)
- #double_right_click(element : Element)
- #double_right_click
- #double_right_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #double_right_click(selector : String, location_strategy : LocationStrategy = :css)
- #drag_and_drop(source : Element, dest : Element)
- #drag_and_drop(source : Element, delta_x : Number, delta_y : Number)
- #drag_and_drop(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
- #drag_and_drop(source : String, dest : String, location_strategy : LocationStrategy = :css)
- #key_down(key : Key | Char)
- #key_down(key : Key | Char, element : Element)
- #key_down(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css)
- #key_up(key : Key | Char)
- #key_up(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css)
-
#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.
-
#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)
- #move_mouse_by(delta_x : Number, delta_y : Number, duration : Time::Span)
- #move_mouse_by(delta_x : Number, delta_y : Number)
- #move_mouse_to(x : Number, y : Number, duration : Time::Span = 0.seconds)
- #move_mouse_to(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
- #move_mouse_to(element : Element, delta_x : Number, delta_y : Number)
- #move_mouse_to(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css)
- #move_mouse_to(element : Element, duration : Time::Span = 0.seconds)
- #move_mouse_to(selector : String, location_strategy : LocationStrategy = :css)
- #pause(duration : Time::Span = 0.seconds)
- #perform(debug_mouse_move = false)
- #release(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #release(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css)
- #release(button : MouseButton = :left)
- #release_right(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
- #release_right(selector : String, location_strategy : LocationStrategy = :css)
- #release_right
- #reset_actions
- #right_click
- #right_click(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
- #right_click(selector : String, location_strategy : LocationStrategy = :css)
- #right_click(element : Element)
- #right_click_and_hold
- #right_click_and_hold(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css)
- #right_click_and_hold(selector : String, location_strategy : LocationStrategy = :css)
- #right_click_and_hold(element : Element)
- #send_keys(selector : String, keys : Array(Key | Char | String))
- #send_keys(element : Element, keys : Array(Key | Char | String))
- #send_keys(keys : Array(Key | Char | String))
- #session : Session
-
#w3c_action(action : Action)
Add a new W3C compatible action and add a pause of the opposite type to keep ticks aligned.
- #w3c_key_actions : Array(Action)
- #w3c_pointer_actions : Array(Action)
Constructor Detail
Instance Method Detail
Create a new PointerDown
action for the given button with the
given click duration.
Create a new PointerUp
action for the given button with the
given click duration.
Create a mouse down action and add it dependant on the W3C status of the current WebDriver.
Create a mouse up action and add it dependant on the W3C status of the current WebDriver.
Add a new W3C compatible action and add a pause of the opposite type to keep ticks aligned.