Packages

A webdriver bidi client written in Gleam, for Gleam.

Current section

Files

Jump to
butterbee src butterbee@by.erl
Raw

src/butterbee@by.erl

-module(butterbee@by).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/butterbee/by.gleam").
-export([xpath/1, css/1, inner_text/2]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" The by module contains functions to specify the type of locator to use\n"
" to query for web elements.\n"
"\n"
" For resources on how to use xpath and css locators, see \n"
" [Xpath cheatsheet](https://devhints.io/xpath).\n"
).
-file("src/butterbee/by.gleam", 9).
-spec xpath(binary()) -> butterbidi@browsing_context@types@locator:locator().
xpath(Value) ->
butterbidi@browsing_context@types@locator:new_xpath_locator(Value).
-file("src/butterbee/by.gleam", 13).
-spec css(binary()) -> butterbidi@browsing_context@types@locator:locator().
css(Value) ->
butterbidi@browsing_context@types@locator:new_css_locator(Value).
-file("src/butterbee/by.gleam", 17).
-spec inner_text(
binary(),
butterbidi@browsing_context@types@locator:match_type()
) -> butterbidi@browsing_context@types@locator:locator().
inner_text(Value, Match_type) ->
_pipe = butterbidi@browsing_context@types@locator:new_inner_text_locator(
Value
),
butterbidi@browsing_context@types@locator:with_match_type(_pipe, Match_type).