# `Fluffy.Assert`
[🔗](https://github.com/ftes/fluffy/blob/v0.8.0/lib/fluffy/assert.ex#L1)

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.Locator

Inside 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.
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.

# `__using__`
*macro* 

Imports the assertion vocabulary without conflicts with ExUnit.

# `assert`

Executes a typed expectation, or delegates an ordinary assertion with a message to ExUnit.

# `assert`

Executes a typed expectation with additional options.

# `assert_event`

Equivalent to `Fluffy.Expect.expect_event/3`.

# `assert_event`

Equivalent to `Fluffy.Expect.expect_event/4`.

# `assert_event`

Equivalent to `Fluffy.Expect.expect_event/5`.

# `assert_has`

Asserts that the locator resolves to a visible element and returns the session.

Equivalent to `assert(session, visible(locator), options)`.
For DOM presence regardless of visibility, use a `count` expectation.

# `checked`

Equivalent to `Fluffy.Expect.to_be_checked/2`.

# `count`

Equivalent to `Fluffy.Expect.to_have_count/3`.

# `disabled`

Equivalent to `Fluffy.Expect.to_be_disabled/2`.

# `editable`

Equivalent to `Fluffy.Expect.to_be_editable/2`.

# `enabled`

Equivalent to `Fluffy.Expect.to_be_enabled/2`.

# `focused`
*Playwright only* 

Equivalent to `Fluffy.Expect.to_be_focused/2`. Requires Playwright.

# `page_opener`

Equivalent to `Fluffy.Expect.page_to_have_opener/2`.

# `page_status`

Equivalent to `Fluffy.Expect.page_to_have_status/2`.

# `page_title`

Equivalent to `Fluffy.Expect.page_to_have_title/2`.

# `page_url`

Equivalent to `Fluffy.Expect.page_to_have_url/2`.

# `refute`

Executes a negated expectation, or delegates an ordinary refutation with a message to ExUnit.

# `refute`

Executes a negated expectation with additional options.

# `refute_has`

Asserts that the locator is absent or hidden and returns the session.

Equivalent to `refute(session, visible(locator), options)`.
Use `count(locator, 0)` to require DOM absence.

# `value`

Equivalent to `Fluffy.Expect.to_have_value/3`.

# `values`

Equivalent to `Fluffy.Expect.to_have_values/3`.

# `visible`

Equivalent to `Fluffy.Expect.to_be_visible/2`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
