ExUnit-style assertions backed by Fluffy.Expect.
Use this module after use ExUnit.Case (or your application's case module)
to replace the conflicting ExUnit imports:
use ExUnit.Case
use Fluffy.Assert
import Fluffy
import Fluffy.LocatorInside a test with an initialized session:
session
|> assert(visible(by_text("Creature registered")))
|> refute(page_title("Error"))Locator constructors take a locator. Page constructors target the active page;
captured-result constructors take the capture key first. All constructors
return Fluffy.Expect values, not booleans.
Ordinary ExUnit assertions, including custom messages and pattern matching,
retain ExUnit semantics. With a typed expectation as the second argument,
assert/2 executes it and refute/2 executes its negation. Both return the
updated session. A third argument supplies expectation options.
Negation retains the driver's retry and missing-element semantics. Refuting
visibility accepts an absent or hidden element; use count(locator, 0) for
absence. Static and Live drivers check structural visibility, while Playwright
checks rendered visibility. Refutation does not turn driver errors into success.
Summary
Functions
Imports the assertion vocabulary without conflicts with ExUnit.
Executes a typed expectation, or delegates an ordinary assertion with a message to ExUnit.
Executes a typed expectation with additional options.
Equivalent to Fluffy.Expect.to_be_checked/2.
Equivalent to Fluffy.Expect.dialog_to_have_default_value/3.
Equivalent to Fluffy.Expect.dialog_to_have_prompt_text/3.
Equivalent to Fluffy.Expect.to_be_disabled/2.
Equivalent to Fluffy.Expect.download_to_have_content/3.
Equivalent to Fluffy.Expect.download_to_have_content_type/3.
Equivalent to Fluffy.Expect.download_to_have_suggested_filename/3.
Equivalent to Fluffy.Expect.to_be_editable/2.
Equivalent to Fluffy.Expect.to_be_enabled/2.
Equivalent to Fluffy.Expect.to_be_focused/2.
Equivalent to Fluffy.Expect.navigation_to_have_from_url/3.
Equivalent to Fluffy.Expect.navigation_to_have_status/3.
Executes a negated expectation, or delegates an ordinary refutation with a message to ExUnit.
Executes a negated expectation with additional options.
Equivalent to Fluffy.Expect.request_to_have_headers/3.
Equivalent to Fluffy.Expect.request_to_have_post_data/3.
Equivalent to Fluffy.Expect.request_to_have_resource_type/3.
Equivalent to Fluffy.Expect.response_to_have_headers/3.
Equivalent to Fluffy.Expect.response_to_have_request_method/3.
Equivalent to Fluffy.Expect.response_to_have_request_post_data/3.
Equivalent to Fluffy.Expect.response_to_have_resource_type/3.
Equivalent to Fluffy.Expect.response_to_have_status/3.
Equivalent to Fluffy.Expect.response_to_have_status_text/3.
Equivalent to Fluffy.Expect.to_be_visible/2.
Functions
Imports the assertion vocabulary without conflicts with ExUnit.
Executes a typed expectation, or delegates an ordinary assertion with a message to ExUnit.
Executes a typed expectation with additional options.
Equivalent to Fluffy.Expect.to_be_checked/2.
Equivalent to Fluffy.Expect.to_have_count/3.
Equivalent to Fluffy.Expect.dialog_to_have_action/3.
Equivalent to Fluffy.Expect.dialog_to_have_default_value/3.
Equivalent to Fluffy.Expect.dialog_to_have_message/3.
Equivalent to Fluffy.Expect.dialog_to_have_prompt_text/3.
Equivalent to Fluffy.Expect.dialog_to_have_type/3.
Equivalent to Fluffy.Expect.to_be_disabled/2.
Equivalent to Fluffy.Expect.download_to_have_content/3.
Equivalent to Fluffy.Expect.download_to_have_content_type/3.
Equivalent to Fluffy.Expect.download_to_have_size/3.
Equivalent to Fluffy.Expect.download_to_have_suggested_filename/3.
Equivalent to Fluffy.Expect.download_to_have_url/3.
Equivalent to Fluffy.Expect.to_be_editable/2.
Equivalent to Fluffy.Expect.to_be_enabled/2.
Equivalent to Fluffy.Expect.to_be_focused/2.
Equivalent to Fluffy.Expect.page_to_have_opener/2.
Equivalent to Fluffy.Expect.page_to_have_status/2.
Equivalent to Fluffy.Expect.page_to_have_title/2.
Equivalent to Fluffy.Expect.page_to_have_url/2.
Executes a negated expectation, or delegates an ordinary refutation with a message to ExUnit.
Executes a negated expectation with additional options.
Equivalent to Fluffy.Expect.request_to_have_headers/3.
Equivalent to Fluffy.Expect.request_to_have_method/3.
Equivalent to Fluffy.Expect.request_to_have_page/3.
Equivalent to Fluffy.Expect.request_to_have_post_data/3.
Equivalent to Fluffy.Expect.request_to_have_resource_type/3.
Equivalent to Fluffy.Expect.request_to_have_url/3.
Equivalent to Fluffy.Expect.response_to_have_headers/3.
Equivalent to Fluffy.Expect.response_to_have_page/3.
Equivalent to Fluffy.Expect.response_to_have_request_method/3.
Equivalent to Fluffy.Expect.response_to_have_request_post_data/3.
Equivalent to Fluffy.Expect.response_to_have_resource_type/3.
Equivalent to Fluffy.Expect.response_to_have_status/3.
Equivalent to Fluffy.Expect.response_to_have_status_text/3.
Equivalent to Fluffy.Expect.response_to_have_url/3.
Equivalent to Fluffy.Expect.to_have_value/3.
Equivalent to Fluffy.Expect.to_have_values/3.
Equivalent to Fluffy.Expect.to_be_visible/2.