class LuckyFlow::Webless::Element

Defined in:

lucky_flow/webless/element.cr

Constant Summary

VISIBILITY_XPATH = "boolean(./ancestor-or-self::*[(((./@style[(contains(., 'display:none') or contains(., 'display: none'))] or ./@hidden) or ((name(.) = 'script') or (name(.) = 'head'))) or (not(./self::summary) and ./parent::details[not(./@open)]))])"

Constructors

Instance Method Summary

Instance methods inherited from class LuckyFlow::Element

append(value : String) append, attribute(name : String) : String | Nil
attribute(name : Symbol) : String | Nil
attribute
, checked? : Bool checked?, clear clear, click click, displayed? : Bool displayed?, driver : LuckyFlow::Driver driver, fill(value : String)
fill(value : Time)
fill
, hover hover, midpoint : NamedTuple(x: Int32, y: Int32) | Nil midpoint, property(name : String) : String | Nil
property(name : Symbol) : String | Nil
property
, raw_selector : String raw_selector, select_option(value : String) select_option, select_options(values : Array(String)) select_options, selected? : Bool selected?, selector : String selector, send_keys(keys : Array(String | Symbol))
send_keys(key : String)
send_keys
, tag_name : String tag_name, text : String text, value value

Macros inherited from class LuckyFlow::Element

unsupported unsupported

Constructor Detail

def self.new(driver, raw_selector, inner_element : HTML5::Node) #

[View source]

Instance Method Detail

def append(value : String) #
Description copied from class LuckyFlow::Element

Add text to the end of a field

field = el("input[name='comment']")
field.fill("Lucky is:")

field.append(" So much fun!")

[View source]
def attribute(name : String) : String | Nil #

[View source]
def check #

[View source]
def checkbox? : Bool #

[View source]
def checked? : Bool #

[View source]
def clear #

[View source]
def click #

[View source]
def displayed? : Bool #

[View source]
def fill(value : String) #
Description copied from class LuckyFlow::Element

Set the text of a form field

field = el("input[name='comment']")

field.fill("Lucky is great!")

[View source]
def midpoint : NamedTuple(x: Int32, y: Int32) | Nil #

[View source]
def property(name : String) : String | Nil #

[View source]
def radio? : Bool #

[View source]
def remove_attribute(name : String, element : HTML5::Node = @inner_element) #

[View source]
def select_option(value : String) #

[View source]
def select_options(values : Array(String)) #

[View source]
def selected? : Bool #

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

[View source]
def set_checkbox(value : Bool) #

[View source]
def set_radio #

[View source]
def tag_name : String #

[View source]
def text : String #

[View source]
def value #

[View source]