sprocket/test_helpers
Types
pub type Event {
ClickEvent
InputEvent(value: String)
MouseMoveEvent(e: events.MouseEvent)
FormChangeEvent(data: Dict(String, String))
FormSubmitEvent(data: Dict(String, String))
BlurEvent
FocusEvent
KeyDownEvent(e: events.KeyEvent)
}
Constructors
-
ClickEvent
-
InputEvent(value: String)
-
MouseMoveEvent(e: events.MouseEvent)
-
FormChangeEvent(data: Dict(String, String))
-
FormSubmitEvent(data: Dict(String, String))
-
BlurEvent
-
FocusEvent
-
KeyDownEvent(e: events.KeyEvent)
pub type FindElementBy {
ById(String)
ByClass(String)
ByTag(String)
ByPredicate(fn(ReconciledElement) -> Bool)
}
Constructors
-
ById(String)
-
ByClass(String)
-
ByTag(String)
-
ByPredicate(fn(ReconciledElement) -> Bool)
Functions
pub fn assert_element(
maybe_el: Result(ReconciledElement, Nil),
) -> ReconciledElement
pub fn assert_regex(
maybe_el: Result(ReconciledElement, Nil),
regex: String,
) -> Bool
pub fn find_element(
spkt: Subject(Message),
one_that is_desired: FindElementBy,
) -> Result(ReconciledElement, Nil)
pub fn has_element(
spkt: Subject(Message),
one_that is_desired: FindElementBy,
) -> Bool
pub fn mouse_move(x: Int, y: Int) -> Event
pub fn render_el_html(el: ReconciledElement) -> String
pub fn render_event(
spkt: Subject(Message),
event: Event,
html_id: String,
) -> Subject(Message)
pub fn render_html(
spkt: Subject(Message),
) -> #(Subject(Message), String)
pub fn wait_until(predicate: fn() -> Bool, timeout: Int) -> Bool
pub fn wait_while(predicate: fn() -> Bool, timeout: Int) -> Bool