Return to Roc packages
Documentation
Tutorial
▶
Test
▶
test
test_with
Browser
▶
open_new_window!
open_new_window_with_cleanup!
close_window!
navigate_to!
get_title!
get_url!
Locator
find_element!
try_find_element!
find_single_element!
find_elements!
take_screenshot_base64!
set_window_rect!
get_window_rect!
navigate_back!
navigate_forward!
reload_page!
maximize_window!
minimize_window!
full_screen_window!
execute_js!
execute_js_with_output!
execute_js_with_args!
Cookie
CookieExpiry
SameSiteOption
add_cookie!
delete_cookie!
delete_all_cookies!
get_cookie!
get_all_cookies!
get_alert_text!
send_text_to_alert!
accept_alert!
dismiss_alert!
get_page_html!
Element
▶
click!
get_text!
get_value!
is_selected!
is_visible!
get_attribute!
get_attribute_or_empty!
get_property!
get_property_or_empty!
input_text!
clear!
Locator
find_element!
try_find_element!
find_single_element!
find_elements!
get_tag_name!
get_css_property!
get_rect!
use_iframe!
Assert
▶
should_be
should_contain_text
should_be_equal_to
should_be_greater_than
should_be_greater_or_equal_to
should_be_lesser_than
should_be_lesser_or_equal_to
url_should_be!
title_should_be!
fail_with
should_have_length
element_should_have_text!
element_should_have_value!
element_should_be_visible!
Debug
▶
print_line!
wait!
wait_for_enter_key!
show_element!
show_elements!
show_current_frame!
Config
▶
R2EConfiguration
default_config
default_config_with
Env
▶
get!
Error
▶
web_driver_error_to_str
Reporting
▶
create_reporter
rename
html_encode
BasicHtmlReporter
▶
reporter
(press
s
)
Test
.
test
Test
.
test_with
Browser
.
open_new_window!
: {} => Result Browser [WebDriverError Str]
Browser
.
open_new_window_with_cleanup!
: (Browser => Result val [WebDriverError Str]err) => Result val [WebDriverError Str]err
Browser
.
close_window!
: Browser => Result {} [WebDriverError Str]
Browser
.
navigate_to!
: Browser, Str => Result {} [WebDriverError Str]
Browser
.
get_title!
: Browser => Result Str [WebDriverError Str]
Browser
.
get_url!
: Browser => Result Str [WebDriverError Str]
Browser
.
Locator
Browser
.
find_element!
: Browser, Locator => Result Element [ WebDriverError Str, ElementNotFound Str ]
Browser
.
try_find_element!
: Browser, Locator => Result [ Found Element, NotFound ] [ WebDriverError Str, ElementNotFound Str ]
Browser
.
find_single_element!
: Browser, Locator => Result Element [ AssertionError Str, ElementNotFound Str, WebDriverError Str ]
Browser
.
find_elements!
: Browser, Locator => Result (List Element) [ WebDriverError Str, ElementNotFound Str ]
Browser
.
take_screenshot_base64!
: Browser => Result Str [WebDriverError Str]
Browser
.
set_window_rect!
: Browser, SetWindowRectOptions => Result WindowRect [WebDriverError Str]
Browser
.
get_window_rect!
: Browser => Result WindowRect [WebDriverError Str]
Browser
.
navigate_back!
: Browser => Result {} [WebDriverError Str]
Browser
.
navigate_forward!
: Browser => Result {} [WebDriverError Str]
Browser
.
reload_page!
: Browser => Result {} [WebDriverError Str]
Browser
.
maximize_window!
: Browser => Result WindowRect [WebDriverError Str]
Browser
.
minimize_window!
: Browser => Result WindowRect [WebDriverError Str]
Browser
.
full_screen_window!
: Browser => Result WindowRect [WebDriverError Str]
Browser
.
execute_js!
: Browser, Str => Result {} [ WebDriverError Str, JsReturnTypeError Str ] where a implements Decoding
Browser
.
execute_js_with_output!
: Browser, Str => Result a [ WebDriverError Str, JsReturnTypeError Str ] where a implements Decoding
Browser
.
execute_js_with_args!
: Browser, Str, List JsValue => Result a [ WebDriverError Str, JsReturnTypeError Str ] where a implements Decoding
Browser
.
Cookie
Browser
.
CookieExpiry
Browser
.
SameSiteOption
: [ None, Lax, Strict ]
Browser
.
add_cookie!
: Browser, NewCookie => Result {} [WebDriverError Str]
Browser
.
delete_cookie!
: Browser, Str => Result {} [ WebDriverError Str, CookieNotFound Str ]
Browser
.
delete_all_cookies!
: Browser => Result {} [WebDriverError Str]
Browser
.
get_cookie!
: Browser, Str => Result Cookie [ WebDriverError Str, CookieNotFound Str ]
Browser
.
get_all_cookies!
: Browser => Result (List Cookie) [ WebDriverError Str, CookieNotFound Str ]
Browser
.
get_alert_text!
: Browser => Result Str [ WebDriverError Str, AlertNotFound Str ]
Browser
.
send_text_to_alert!
: Browser, Str => Result {} [ WebDriverError Str, AlertNotFound Str ]
Browser
.
accept_alert!
: Browser => Result {} [ WebDriverError Str, AlertNotFound Str ]
Browser
.
dismiss_alert!
: Browser => Result {} [ WebDriverError Str, AlertNotFound Str ]
Browser
.
get_page_html!
: Browser => Result Str [WebDriverError Str]
Element
.
click!
: Element => Result {} [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_text!
: Element => Result Str [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_value!
: Element => Result a [ ElementNotFound Str, PropertyTypeError Str, WebDriverError Str ] where a implements Decoding
Element
.
is_selected!
: Element => Result [ Selected, NotSelected ] [ WebDriverError Str, ElementNotFound Str ]
Element
.
is_visible!
: Element => Result [ Visible, NotVisible ] [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_attribute!
: Element, Str => Result Str [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_attribute_or_empty!
: Element, Str => Result (Result Str [Empty]) [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_property!
: Internal.Element, Str => Result a [ ElementNotFound Str, PropertyTypeError Str, WebDriverError Str ] where a implements Decoding
Element
.
get_property_or_empty!
: Element, Str => Result (Result a [Empty]) [ WebDriverError Str, ElementNotFound Str, PropertyTypeError Str ] where a implements Decoding
Element
.
input_text!
: Element, Str => Result {} [ WebDriverError Str, ElementNotFound Str ]
Element
.
clear!
: Internal.Element => Result {} [ WebDriverError Str, ElementNotFound Str ]
Element
.
Locator
Element
.
find_element!
: Element, Locator => Result Element [ WebDriverError Str, ElementNotFound Str ]
Element
.
try_find_element!
: Element, Locator => Result [ Found Element, NotFound ] [ WebDriverError Str, ElementNotFound Str ]
Element
.
find_single_element!
: Element, Locator => Result Element [ AssertionError Str, ElementNotFound Str, WebDriverError Str ]
Element
.
find_elements!
: Element, Locator => Result (List Element) [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_tag_name!
: Element => Result Str [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_css_property!
: Element, Str => Result Str [ WebDriverError Str, ElementNotFound Str ]
Element
.
get_rect!
: Element => Result ElementRect [ WebDriverError Str, ElementNotFound Str ]
Element
.
use_iframe!
: Element, (Internal.Browser => Result {} ) => Result {}
Assert
.
should_be
: a, a -> Result {} [AssertionError Str] where a implements Eq & Inspect
Assert
.
should_contain_text
: Str, Str -> Result {} [AssertionError Str]
Assert
.
should_be_equal_to
: Frac a, Frac a -> Result {} [AssertionError Str]
Assert
.
should_be_greater_than
: Num a, Num a -> Result {} [AssertionError Str] where a implements Bool.Eq
Assert
.
should_be_greater_or_equal_to
: Num a, Num a -> Result {} [AssertionError Str] where a implements Bool.Eq
Assert
.
should_be_lesser_than
: Num a, Num a -> Result {} [AssertionError Str] where a implements Bool.Eq
Assert
.
should_be_lesser_or_equal_to
: Num a, Num a -> Result {} [AssertionError Str] where a implements Bool.Eq
Assert
.
url_should_be!
: Browser, Str => Result {} [ AssertionError Str, WebDriverError Str ]
Assert
.
title_should_be!
: Browser, Str => Result {} [ AssertionError Str, WebDriverError Str ]
Assert
.
fail_with
: Str -> Result [AssertionError Str]
Assert
.
should_have_length
: List a, U64 -> Result {} [AssertionError Str]
Assert
.
element_should_have_text!
: Element, Str => Result {} [ AssertionError Str, ElementNotFound Str, WebDriverError Str ]
Assert
.
element_should_have_value!
: Element, Str => Result {} [ AssertionError Str, ElementNotFound Str, WebDriverError Str, PropertyTypeError Str ]
Assert
.
element_should_be_visible!
: Element => Result {} [ AssertionError Str, ElementNotFound Str, WebDriverError Str ]
Debug
.
print_line!
: Str => {}
Debug
.
wait!
: U64 => {}
Debug
.
wait_for_enter_key!
: {} => {}
Debug
.
show_element!
: Element => Result {} [ WebDriverError Str, JsReturnTypeError Str ]
Debug
.
show_elements!
: List Element => Result {} [ WebDriverError Str, JsReturnTypeError Str ]
Debug
.
show_current_frame!
: Browser => Result {} [ WebDriverError Str, JsReturnTypeError Str ]
Config
.
R2EConfiguration
Config
.
default_config
: R2EConfiguration
Config
.
default_config_with
: { results_dir_name ? Str, reporters ? List (ReporterDefinition ), assert_timeout ? U64, page_load_timeout ? U64, script_execution_timeout ? U64, element_implicit_timeout ? U64, window_size ? [Size U64 U64], screenshot_on_fail ? [ Yes, No ], attempts ? U64 } -> R2EConfiguration
Env
.
get!
: Str => Str
Error
.
web_driver_error_to_str
Reporting
.
create_reporter
: Str, ReporterCallback err -> ReporterDefinition err
Reporting
.
rename
: ReporterDefinition err, Str -> ReporterDefinition err
Reporting
.
html_encode
: Str -> Str
BasicHtmlReporter
.
reporter
Exposed Modules
LLM docs
Tutorial
Test
Browser
Element
Assert
Debug
Config
Env
Error
Reporting
BasicHtmlReporter