class Marionette::ActionBuilder

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:

marionette/actions.cr

Constant Summary

DEBUG_MOUSE_MOVE_SCRIPT = {{ read_file("/srv/crystaldoc.info/github-watzon-marionette-v0.3.0/src/marionette/scripts/debug_mouse_move.js") }}

Constructors

Instance Method Summary

Constructor Detail

def self.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)) #

[View source]

Instance Method Detail

def action(command : String, action : Action) #

Add a non-W3C compatible action.


[View source]
def actions : Array(Tuple(String, Action)) #

[View source]
def clear_actions #

[View source]
def click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def click(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def click(button : MouseButton = :left) #

[View source]
def click(element : Element, button : MouseButton = :left) #

[View source]
def click_and_hold(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def click_and_hold(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def click_and_hold(button : MouseButton = :left) #

[View source]
def click_and_hold(element : Element, button : MouseButton = :left) #

[View source]
def create_key_down(key : Key | Char | String) #

Create a new KeyDown action with the given value


[View source]
def create_key_up(key : Key | Char | String) #

Create a new KeyUp action with the given value


[View source]
def create_mouse_down(button : MouseButton, duration : Time::Span = 0.seconds) #

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


[View source]
def create_mouse_up(button : MouseButton, duration : Time::Span = 0.seconds) #

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


[View source]
def create_pointer_move(x : Number, y : Number, duration : Time::Span = 0.seconds, origin = Origin::ViewPort.new) #

[View source]
def create_pointer_move(x : Number, y : Number, selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css) #

[View source]
def create_pointer_move(x : Number, y : Number, element : Element, duration : Time::Span = 0.seconds) #

[View source]
def create_pointer_move(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css) #

[View source]
def create_pointer_move(element : Element, duration : Time::Span = 0.seconds) #

[View source]
def double_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def double_click(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def double_click(button : MouseButton = :left) #

[View source]
def double_click(element : Element, button : MouseButton = :left) #

[View source]
def double_right_click(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def double_right_click(selector : String, location_strategy : LocationStrategy = :css) #

[View source]
def double_right_click(element : Element) #

[View source]
def double_right_click #

[View source]
def drag_and_drop(source : String, dest : String, location_strategy : LocationStrategy = :css) #

[View source]
def drag_and_drop(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css) #

[View source]
def drag_and_drop(source : Element, delta_x : Number, delta_y : Number) #

[View source]
def drag_and_drop(source : Element, dest : Element) #

[View source]
def key_down(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css) #

[View source]
def key_down(key : Key | Char, element : Element) #

[View source]
def key_down(key : Key | Char) #

[View source]
def key_up(key : Key | Char, selector : String, location_strategy : LocationStrategy = :css) #

[View source]
def key_up(key : Key | Char) #

[View source]
def 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.


[View source]
def 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.


[View source]
def move_mouse(x : Number, y : Number, duration : Time::Span = 0.seconds, origin = Origin::ViewPort.new) #

[View source]
def move_mouse_by(delta_x : Number, delta_y : Number, duration : Time::Span) #

[View source]
def move_mouse_by(delta_x : Number, delta_y : Number) #

[View source]
def move_mouse_to(x : Number, y : Number, duration : Time::Span = 0.seconds) #

[View source]
def move_mouse_to(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css) #

[View source]
def move_mouse_to(element : Element, delta_x : Number, delta_y : Number) #

[View source]
def move_mouse_to(selector : String, duration : Time::Span = 0.seconds, location_strategy : LocationStrategy = :css) #

[View source]
def move_mouse_to(element : Element, duration : Time::Span = 0.seconds) #

[View source]
def move_mouse_to(selector : String, location_strategy : LocationStrategy = :css) #

[View source]
def pause(duration : Time::Span = 0.seconds) #

[View source]
def perform(debug_mouse_move = false) #

[View source]
def release(selector : String, delta_x : Number, delta_y : Number, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def release(selector : String, button : MouseButton = :left, location_strategy : LocationStrategy = :css) #

[View source]
def release(button : MouseButton = :left) #

[View source]
def release_right(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css) #

[View source]
def release_right(selector : String, location_strategy : LocationStrategy = :css) #

[View source]
def release_right #

[View source]
def reset_actions #

[View source]
def right_click(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css) #

[View source]
def right_click(selector : String, location_strategy : LocationStrategy = :css) #

[View source]
def right_click(element : Element) #

[View source]
def right_click #

[View source]
def right_click_and_hold(selector : String, delta_x : Number, delta_y : Number, location_strategy : LocationStrategy = :css) #

[View source]
def right_click_and_hold(selector : String, location_strategy : LocationStrategy = :css) #

[View source]
def right_click_and_hold(element : Element) #

[View source]
def right_click_and_hold #

[View source]
def send_keys(selector : String, keys : Array(Key | Char | String)) #

[View source]
def send_keys(element : Element, keys : Array(Key | Char | String)) #

[View source]
def send_keys(keys : Array(Key | Char | String)) #

[View source]
def session : Session #

[View source]
def w3c_action(action : Action) #

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


[View source]
def w3c_key_actions : Array(Action) #

[View source]
def w3c_pointer_actions : Array(Action) #

[View source]