class Stoertebeker::Context

Overview

Starts and terminates the electron server and connects the crystal client to it. Commands can be executed against the server vie IPC from this context, using the DSL methods.

Included Modules

Defined in:

stoertebeker.cr

Constructors

Instance Method Summary

Instance methods inherited from module Stoertebeker::DSL

click(selector) click, current_path current_path, current_url current_url, evaluate(script) evaluate, execute(*args)
execute(*args, &block : JSON::Any -> )
execute
, exists?(selector) exists?, inner_html(selector) inner_html, page_title page_title, ping ping, quit(*args) quit, request(*args) request, screenshot(*args) screenshot, set_value(selector, value) set_value, wait_for(*args, **kwargs) wait_for, window(**args) window

Constructor Detail

def self.new(server_address = Socket::UNIXAddress.new(SOCKET_FILE), *args) #

[View source]

Instance Method Detail

def client : RemoteClient #

[View source]
def debugging? : Bool #

[View source]
def server_process : Process | Nil #

[View source]
def server_process? : Process | Nil | Nil #

[View source]
def start_client #

Connects the client to the electron socket and pings the server.


[View source]
def start_server #

Starts the electron server. It first runs npm install and raises if it fails. Waits for the socket file to be created.


[View source]
def stop_server #

Stops the server by firs sending the quit-command and then killing the process.


[View source]