class LuckyFlow

Included Modules

Defined in:

lucky_flow.cr:5
lucky_flow.cr:10
lucky_flow/errors.cr
lucky_flow/expectations.cr
lucky_flow/version.cr

Constant Summary

HABITAT_SETTINGS = [{decl: screenshot_directory : String = "./tmp/screenshots", example: nil, validation: nil}, {decl: base_uri : String, example: nil, validation: nil}, {decl: retry_delay : Time::Span = 10.milliseconds, example: nil, validation: nil}, {decl: stop_retrying_after : Time::Span = 1.second, example: nil, validation: nil}, {decl: driver_path : String | ::Nil, example: nil, validation: nil}, {decl: browser_binary : String | ::Nil = nil, example: nil, validation: nil}, {decl: driver : LuckyFlow::Driver.class = LuckyFlow::Drivers::HeadlessChrome, example: nil, validation: nil}] of Nil
SERVER = LuckyFlow::Server::INSTANCE
VERSION = "0.7.3"

Class Method Summary

Instance Method Summary

Class Method Detail

def self.configure(&) #

[View source]
def self.reset #

[View source]
def self.session #

[View source]
def self.settings #

[View source]
def self.shutdown #

[View source]

Instance Method Detail

def accept_alert #

[View source]
def append(name_attr : String, with value : String) #

Add text to the end of a field

fill("comment:body", with: "Lucky is:")

append("comment:body", " So much fun!")

[View source]
def click(css_selector : String) #

[View source]
def current_path #

[View source]
def dismiss_alert #

[View source]
def el(css_selector : String) #

[View source]
def el(css_selector : String, text : String) #

[View source]
def expand_page_to_fullsize #

[View source]
def field(name_attr : String) #

[View source]
def fill(name_attr : String, with value : String) #

Set the text of a form field, clearing any existing text

fill("comment:body", with: "Lucky is great!")

[View source]
def fill(element : Element, with value : String) #

[View source]
def fill_form(form : Avram::SaveOperation.class | Avram::Operation.class, **fields_and_values) #

Fill a form created by Lucky that uses an Avram::SaveOperation

Note that Lucky and Avram are required to use this method

fill_form QuestionForm,
  title: "Hello there!",
  body: "Just wondering what day it is"

[View source]
def open_screenshot(process = Process, time = Time.utc, fullsize = false) : Void #

[View source]
def pause #

[View source]
def select(element : Element, value : String) #

[View source]
def select(element : Element, value : Array(String)) #

[View source]
def select(name_attr : String, value : Array(String) | String) #

Select an option from a select element

select("post:category", value: "rant")

If given an Array(String), the select is assumed to have the 'multiple' attribute and will raise a LuckyFlow::InvalidMultiSelectError if it doesn't.

select("post:tags", value: ["rant", "technology"])

[View source]
def session #

[View source]
def settings #

[View source]
def take_screenshot(filename : String = generate_screenshot_filename, fullsize : Bool = true) #

[View source]
def visit(route_helper : Lucky::RouteHelper, as user : User? = nil) #

[View source]
def visit(action : Lucky::Action.class, as user : User? = nil) #

[View source]
def visit(path : String) #

[View source]
def with_fullsized_page(&) #

[View source]