# `Playwright.Expect`
[🔗](https://github.com/ftes/playwright_ex/blob/v1.65.0-rc.3/lib/playwright/api/expect.ex#L7)

Web-first assertions: the methods of [`LocatorAssertions`](https://playwright.dev/docs/api/class-locatorassertions), [`PageAssertions`](https://playwright.dev/docs/api/class-pageassertions) and [`APIResponseAssertions`](https://playwright.dev/docs/api/class-apiresponseassertions), as functions of their receiver.

`expect(locator).toHaveText(expected)` is `to_have_text(locator, expected)`, `expect(locator).not.toHaveText(expected)` is `not_to_have_text(locator, expected)` or `locator |> not_() |> to_have_text(expected)`, and a soft assertion is `locator |> soft() |> to_have_text(expected)` (see `soft/1`). They retry until the expectation is met or the timeout (5 seconds by default, see Configuration below) passes, then return `:ok` or `{:error, %Playwright.ExpectError{}}` whose `matcherResult` mirrors JS; the bang forms raise the `Playwright.ExpectError` ([Testing with ExUnit](testing-with-exunit.md) shows how to wrap it in an `ExUnit.AssertionError`).

The [`LocatorAssertions`](https://playwright.dev/docs/api/class-locatorassertions) class provides assertion methods that can be used to make assertions about the [`Locator`](`Playwright.Locator`) state in the tests.

```elixir
test "status becomes submitted", %{page: page} do
  # ...
  Page.get_by_role(page, :button) |> Locator.click!()
  Page.locator(page, ".status") |> Expect.to_have_text!("Submitted")
end
```

## Configuration

The `expect` part of upstream's `playwright.config.ts`, read when a matcher runs (so an
`Application.put_env/3` in `test_helper.exs` applies too):

    config :playwright, :expect, timeout: 10_000, update_snapshots: :missing

The keys (other keys raise `ArgumentError`, at application start for the config files):

  * `:timeout` - Default timeout of the matchers in milliseconds. Defaults to `5000`. A
    `timeout:` option of a matcher wins. `:infinity` is no limit, and so is `0`, as in
    Playwright: `0` never means "fail at once" (see [API conventions](api-conventions.md)).
  * `:update_snapshots` - When `to_have_screenshot` and `to_match_aria_snapshot` write snapshots:
    `:all`, `:changed`, `:missing`, `:none` or `:default` (the default: write missing ones,
    which fails a `Playwright.Test` test at its end, as upstream's). A snapshot is written to
    the file its `name:` resolves to in a `Playwright.Test` test, or to its `path:`. An
    inline aria snapshot is not written into the test source, so where upstream suggests a
    rebaseline (an empty snapshot, or any under `:all` or a mismatch under `:changed`) the
    matcher fails with the new snapshot in its message.
  * `:ignore_snapshots` - Skip the snapshot matchers. Defaults to `false`.
  * `:to_pass` - Defaults of `Playwright.Expect.to_pass/2`'s options, `[timeout: 10_000,
    intervals: [1000]]`. Its timeout defaults to `0`, no limit of its own (the test's timeout
    bounds it), not `:timeout`; `:infinity` is `0`.
  * `:to_have_screenshot` - Defaults of `Playwright.Expect.to_have_screenshot/2`'s options, as
    it names them: `:animations`, `:caret`, `:max_diff_pixels`, `:max_diff_pixel_ratio`,
    `:scale`, `:style_path`, `:threshold` and `:timeout` (over the expect `:timeout`, under a
    call's), as in `[max_diff_pixels: 10]`, and the config's own `:type` (`:png` or `:webp`, of
    an unnamed snapshot) and `:path_template` (see "Snapshots" in `Playwright.Test`).
  * `:to_match_aria_snapshot` - `:children` (`:contain`, `:equal` or `:deep_equal`: the
    `/children` mode of a snapshot that sets none) and `:path_template`.

The keys are upstream's config keys, snake_case; each takes a keyword list or a map.

*Since Playwright 1.17.*

The examples alias the modules they use (`alias Playwright.{Locator, Page}`).

# `not_to_be_attached_options`

```elixir
@type not_to_be_attached_options() ::
  [
    attached: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:attached) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_attached/2`, see its docs.

# `not_to_be_checked_options`

```elixir
@type not_to_be_checked_options() ::
  [
    checked: boolean(),
    indeterminate: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:checked) =&gt; boolean(),
      optional(:indeterminate) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_checked/2`, see its docs.

# `not_to_be_disabled_options`

```elixir
@type not_to_be_disabled_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_disabled/2`, see its docs.

# `not_to_be_editable_options`

```elixir
@type not_to_be_editable_options() ::
  [
    editable: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:editable) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_editable/2`, see its docs.

# `not_to_be_empty_options`

```elixir
@type not_to_be_empty_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_empty/2`, see its docs.

# `not_to_be_enabled_options`

```elixir
@type not_to_be_enabled_options() ::
  [
    enabled: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:enabled) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_enabled/2`, see its docs.

# `not_to_be_focused_options`

```elixir
@type not_to_be_focused_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_focused/2`, see its docs.

# `not_to_be_hidden_options`

```elixir
@type not_to_be_hidden_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_hidden/2`, see its docs.

# `not_to_be_in_viewport_options`

```elixir
@type not_to_be_in_viewport_options() ::
  [
    ratio: number(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ratio) =&gt; number(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_be_in_viewport/2`, see its docs.

# `not_to_be_visible_options`

```elixir
@type not_to_be_visible_options() ::
  [
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    visible: boolean()
  ]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:visible) =&gt; boolean()
    }
```

Options of `not_to_be_visible/2`, see its docs.

# `not_to_contain_class_options`

```elixir
@type not_to_contain_class_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_contain_class/3`, see its docs.

# `not_to_contain_text_options`

```elixir
@type not_to_contain_text_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    use_inner_text: boolean()
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:use_inner_text) =&gt; boolean()
    }
```

Options of `not_to_contain_text/3`, see its docs.

# `not_to_have_accessible_description_options`

```elixir
@type not_to_have_accessible_description_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_accessible_description/3`, see its docs.

# `not_to_have_accessible_error_message_options`

```elixir
@type not_to_have_accessible_error_message_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_accessible_error_message/3`, see its docs.

# `not_to_have_accessible_name_options`

```elixir
@type not_to_have_accessible_name_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_accessible_name/3`, see its docs.

# `not_to_have_attribute_options`

```elixir
@type not_to_have_attribute_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_attribute/4`, see its docs.

# `not_to_have_class_options`

```elixir
@type not_to_have_class_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_class/3`, see its docs.

# `not_to_have_count_options`

```elixir
@type not_to_have_count_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_count/3`, see its docs.

# `not_to_have_css_options`

```elixir
@type not_to_have_css_options() ::
  [
    pseudo: :before | :after,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:pseudo) =&gt; :before | :after,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_css/4`, see its docs.

# `not_to_have_id_options`

```elixir
@type not_to_have_id_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_id/3`, see its docs.

# `not_to_have_js_property_options`

```elixir
@type not_to_have_js_property_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_js_property/4`, see its docs.

# `not_to_have_role_options`

```elixir
@type not_to_have_role_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_role/3`, see its docs.

# `not_to_have_screenshot_options`

```elixir
@type not_to_have_screenshot_options() ::
  [
    name: String.t() | [String.t()],
    path: String.t(),
    animations: :disabled | :allow,
    caret: :hide | :initial,
    mask: [Playwright.Locator.t()],
    mask_color: String.t(),
    max_diff_pixel_ratio: number(),
    max_diff_pixels: integer(),
    omit_background: boolean(),
    scale: :css | :device,
    signal: Playwright.AbortSignal.t(),
    style_path: String.t() | [String.t()],
    threshold: number(),
    timeout: number() | :infinity,
    clip: %{x: number(), y: number(), width: number(), height: number()},
    full_page: boolean()
  ]
  | %{
      optional(:name) =&gt; String.t() | [String.t()],
      optional(:path) =&gt; String.t(),
      optional(:animations) =&gt; :disabled | :allow,
      optional(:caret) =&gt; :hide | :initial,
      optional(:mask) =&gt; [Playwright.Locator.t()],
      optional(:mask_color) =&gt; String.t(),
      optional(:max_diff_pixel_ratio) =&gt; number(),
      optional(:max_diff_pixels) =&gt; integer(),
      optional(:omit_background) =&gt; boolean(),
      optional(:scale) =&gt; :css | :device,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:style_path) =&gt; String.t() | [String.t()],
      optional(:threshold) =&gt; number(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:clip) =&gt; %{
        x: number(),
        y: number(),
        width: number(),
        height: number()
      },
      optional(:full_page) =&gt; boolean()
    }
```

Options of `not_to_have_screenshot/2`, see its docs.

# `not_to_have_text_options`

```elixir
@type not_to_have_text_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    use_inner_text: boolean()
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:use_inner_text) =&gt; boolean()
    }
```

Options of `not_to_have_text/3`, see its docs.

# `not_to_have_title_options`

```elixir
@type not_to_have_title_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_title/3`, see its docs.

# `not_to_have_url_options`

```elixir
@type not_to_have_url_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_url/3`, see its docs.

# `not_to_have_value_options`

```elixir
@type not_to_have_value_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_value/3`, see its docs.

# `not_to_have_values_options`

```elixir
@type not_to_have_values_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_have_values/3`, see its docs.

# `not_to_match_aria_snapshot_options`

```elixir
@type not_to_match_aria_snapshot_options() ::
  [
    name: String.t(),
    path: String.t(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:name) =&gt; String.t(),
      optional(:path) =&gt; String.t(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_match_aria_snapshot/3`, see its docs.

# `not_to_pass_options`

```elixir
@type not_to_pass_options() ::
  [intervals: [integer()], timeout: number() | :infinity]
  | %{
      optional(:intervals) =&gt; [integer()],
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `not_to_pass/2`, see its docs.

# `poll_options`

```elixir
@type poll_options() ::
  [intervals: [integer()], message: String.t(), timeout: number() | :infinity]
  | %{
      optional(:intervals) =&gt; [integer()],
      optional(:message) =&gt; String.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `poll/3`, see its docs.

# `t`

```elixir
@type t() ::
  t(
    Playwright.Locator.t()
    | Playwright.Page.t()
    | Playwright.APIResponse.t()
    | (-&gt; term())
  )
```

A negated, soft or messaged receiver of any matcher.

# `t`

```elixir
@type t(actual) :: %Playwright.Expect{
  actual: actual,
  isNot: boolean(),
  isSoft: boolean(),
  message: String.t() | nil
}
```

A negated (`not_/1`), soft (`soft/1`) or messaged (`message/2`) receiver: `expect(actual).not`, `expect.soft(actual)`, `expect(actual, message)` in JS.

# `to_be_attached_options`

```elixir
@type to_be_attached_options() ::
  [
    attached: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:attached) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_attached/2`, see its docs.

# `to_be_checked_options`

```elixir
@type to_be_checked_options() ::
  [
    checked: boolean(),
    indeterminate: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:checked) =&gt; boolean(),
      optional(:indeterminate) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_checked/2`, see its docs.

# `to_be_disabled_options`

```elixir
@type to_be_disabled_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_disabled/2`, see its docs.

# `to_be_editable_options`

```elixir
@type to_be_editable_options() ::
  [
    editable: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:editable) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_editable/2`, see its docs.

# `to_be_empty_options`

```elixir
@type to_be_empty_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_empty/2`, see its docs.

# `to_be_enabled_options`

```elixir
@type to_be_enabled_options() ::
  [
    enabled: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:enabled) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_enabled/2`, see its docs.

# `to_be_focused_options`

```elixir
@type to_be_focused_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_focused/2`, see its docs.

# `to_be_hidden_options`

```elixir
@type to_be_hidden_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_hidden/2`, see its docs.

# `to_be_in_viewport_options`

```elixir
@type to_be_in_viewport_options() ::
  [
    ratio: number(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ratio) =&gt; number(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_be_in_viewport/2`, see its docs.

# `to_be_visible_options`

```elixir
@type to_be_visible_options() ::
  [
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    visible: boolean()
  ]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:visible) =&gt; boolean()
    }
```

Options of `to_be_visible/2`, see its docs.

# `to_contain_class_options`

```elixir
@type to_contain_class_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_contain_class/3`, see its docs.

# `to_contain_text_options`

```elixir
@type to_contain_text_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    use_inner_text: boolean()
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:use_inner_text) =&gt; boolean()
    }
```

Options of `to_contain_text/3`, see its docs.

# `to_have_accessible_description_options`

```elixir
@type to_have_accessible_description_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_accessible_description/3`, see its docs.

# `to_have_accessible_error_message_options`

```elixir
@type to_have_accessible_error_message_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_accessible_error_message/3`, see its docs.

# `to_have_accessible_name_options`

```elixir
@type to_have_accessible_name_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_accessible_name/3`, see its docs.

# `to_have_attribute_options`

```elixir
@type to_have_attribute_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_attribute/4`, see its docs.

# `to_have_class_options`

```elixir
@type to_have_class_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_class/3`, see its docs.

# `to_have_count_options`

```elixir
@type to_have_count_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_count/3`, see its docs.

# `to_have_css_options`

```elixir
@type to_have_css_options() ::
  [
    pseudo: :before | :after,
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:pseudo) =&gt; :before | :after,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_css/4`, see its docs.

# `to_have_id_options`

```elixir
@type to_have_id_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_id/3`, see its docs.

# `to_have_js_property_options`

```elixir
@type to_have_js_property_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_js_property/4`, see its docs.

# `to_have_role_options`

```elixir
@type to_have_role_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_role/3`, see its docs.

# `to_have_screenshot_options`

```elixir
@type to_have_screenshot_options() ::
  [
    name: String.t() | [String.t()],
    path: String.t(),
    animations: :disabled | :allow,
    caret: :hide | :initial,
    mask: [Playwright.Locator.t()],
    mask_color: String.t(),
    max_diff_pixel_ratio: number(),
    max_diff_pixels: integer(),
    omit_background: boolean(),
    scale: :css | :device,
    signal: Playwright.AbortSignal.t(),
    style_path: String.t() | [String.t()],
    threshold: number(),
    timeout: number() | :infinity,
    clip: %{x: number(), y: number(), width: number(), height: number()},
    full_page: boolean()
  ]
  | %{
      optional(:name) =&gt; String.t() | [String.t()],
      optional(:path) =&gt; String.t(),
      optional(:animations) =&gt; :disabled | :allow,
      optional(:caret) =&gt; :hide | :initial,
      optional(:mask) =&gt; [Playwright.Locator.t()],
      optional(:mask_color) =&gt; String.t(),
      optional(:max_diff_pixel_ratio) =&gt; number(),
      optional(:max_diff_pixels) =&gt; integer(),
      optional(:omit_background) =&gt; boolean(),
      optional(:scale) =&gt; :css | :device,
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:style_path) =&gt; String.t() | [String.t()],
      optional(:threshold) =&gt; number(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:clip) =&gt; %{
        x: number(),
        y: number(),
        width: number(),
        height: number()
      },
      optional(:full_page) =&gt; boolean()
    }
```

Options of `to_have_screenshot/2`, see its docs.

# `to_have_text_options`

```elixir
@type to_have_text_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity,
    use_inner_text: boolean()
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity,
      optional(:use_inner_text) =&gt; boolean()
    }
```

Options of `to_have_text/3`, see its docs.

# `to_have_title_options`

```elixir
@type to_have_title_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_title/3`, see its docs.

# `to_have_url_options`

```elixir
@type to_have_url_options() ::
  [
    ignore_case: boolean(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:ignore_case) =&gt; boolean(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_url/3`, see its docs.

# `to_have_value_options`

```elixir
@type to_have_value_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_value/3`, see its docs.

# `to_have_values_options`

```elixir
@type to_have_values_options() ::
  [signal: Playwright.AbortSignal.t(), timeout: number() | :infinity]
  | %{
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_have_values/3`, see its docs.

# `to_match_aria_snapshot_options`

```elixir
@type to_match_aria_snapshot_options() ::
  [
    name: String.t(),
    path: String.t(),
    signal: Playwright.AbortSignal.t(),
    timeout: number() | :infinity
  ]
  | %{
      optional(:name) =&gt; String.t(),
      optional(:path) =&gt; String.t(),
      optional(:signal) =&gt; Playwright.AbortSignal.t(),
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_match_aria_snapshot/3`, see its docs.

# `to_pass_options`

```elixir
@type to_pass_options() ::
  [intervals: [integer()], timeout: number() | :infinity]
  | %{
      optional(:intervals) =&gt; [integer()],
      optional(:timeout) =&gt; number() | :infinity
    }
```

Options of `to_pass/2`, see its docs.

# `message`

```elixir
@spec message(actual | t(actual), String.t()) :: t(actual)
when actual:
       Playwright.Locator.t()
       | Playwright.Page.t()
       | Playwright.APIResponse.t()
       | (-&gt; term())
```

You can specify a custom expect message, for example:

```elixir
Page.get_by_text(page, "Name") |> Expect.message("should be logged in") |> Expect.to_be_visible!()
```

This message will be shown in reporters, both for passing and failing expects, providing more context about the assertion.

In Elixir, `message/2` wraps the receiver as `not_/1` and `soft/1` do, in any order with them: `locator |> Expect.soft() |> Expect.message("my soft assertion")` is a soft assertion with a custom message. The message is the matcher's step title in a `Playwright.Test` test and the first paragraph of its `Playwright.ExpectError`. A `:message` option of `poll/3` wins over it.

# `not_`

```elixir
@spec not_(actual | t(actual)) :: t(actual)
when actual:
       Playwright.Locator.t()
       | Playwright.Page.t()
       | Playwright.APIResponse.t()
       | (-&gt; term())
```

Makes the assertion check for the opposite condition.

**Usage**

For example, this code tests that the Locator doesn't contain text `"error"`:

```elixir
locator |> Expect.not_() |> Expect.to_contain_text!("error")
```

In Elixir, `not_/1` wraps the receiver, which every matcher takes too: `locator |> Expect.not_() |> Expect.to_contain_text("error")` is `Expect.not_to_contain_text(locator, "error")`. As JS has no `expect(x).not.not`, a negated receiver is not negated again: `not_/1` and the `not_to_*` matchers raise `ArgumentError` for one.

*Since Playwright 1.20.*

# `not_to_be_attached`

```elixir
@spec not_to_be_attached(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_attached_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_be_attached/2`: `expect(x).not.toBeAttached(...)` in JS.

*Since Playwright 1.33.*

## Options

* `:attached` (`t:boolean/0`)
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_attached!`

```elixir
@spec not_to_be_attached!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_attached_options()
) :: :ok
```

Like `not_to_be_attached/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_checked`

```elixir
@spec not_to_be_checked(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_checked_options()
) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_be_checked/2`: `expect(x).not.toBeChecked(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:checked` (`t:boolean/0`) - Provides state to assert for. Asserts for input to be checked by default.
  This option can't be used when `:indeterminate` is set to true.
* `:indeterminate` (`t:boolean/0`) - *Since Playwright 1.50.* Asserts that the element is in the indeterminate (mixed) state. Only supported for checkboxes and radio buttons.
  This option can't be true when `:checked` is provided.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_checked!`

```elixir
@spec not_to_be_checked!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_checked_options()
) :: :ok
```

Like `not_to_be_checked/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_disabled`

```elixir
@spec not_to_be_disabled(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_disabled_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_be_disabled/2`: `expect(x).not.toBeDisabled(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_disabled!`

```elixir
@spec not_to_be_disabled!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_disabled_options()
) :: :ok
```

Like `not_to_be_disabled/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_editable`

```elixir
@spec not_to_be_editable(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_editable_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_be_editable/2`: `expect(x).not.toBeEditable(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:editable` (`t:boolean/0`) - *Since Playwright 1.26.*
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_editable!`

```elixir
@spec not_to_be_editable!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_editable_options()
) :: :ok
```

Like `not_to_be_editable/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_empty`

```elixir
@spec not_to_be_empty(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_empty_options()
) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_be_empty/2`: `expect(x).not.toBeEmpty(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_empty!`

```elixir
@spec not_to_be_empty!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_empty_options()
) ::
  :ok
```

Like `not_to_be_empty/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_enabled`

```elixir
@spec not_to_be_enabled(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_enabled_options()
) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_be_enabled/2`: `expect(x).not.toBeEnabled(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:enabled` (`t:boolean/0`) - *Since Playwright 1.26.*
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_enabled!`

```elixir
@spec not_to_be_enabled!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_enabled_options()
) :: :ok
```

Like `not_to_be_enabled/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_focused`

```elixir
@spec not_to_be_focused(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_focused_options()
) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_be_focused/2`: `expect(x).not.toBeFocused(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_focused!`

```elixir
@spec not_to_be_focused!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_focused_options()
) :: :ok
```

Like `not_to_be_focused/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_hidden`

```elixir
@spec not_to_be_hidden(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_hidden_options()
) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_be_hidden/2`: `expect(x).not.toBeHidden(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_hidden!`

```elixir
@spec not_to_be_hidden!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_hidden_options()
) ::
  :ok
```

Like `not_to_be_hidden/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_in_viewport`

```elixir
@spec not_to_be_in_viewport(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_in_viewport_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_be_in_viewport/2`: `expect(x).not.toBeInViewport(...)` in JS.

*Since Playwright 1.31.*

## Options

* `:ratio` (`t:number/0`) - The minimal ratio of the element to intersect viewport. If equals to `0`, then
  element should intersect viewport at any positive ratio. Defaults to `0`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_be_in_viewport!`

```elixir
@spec not_to_be_in_viewport!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_in_viewport_options()
) :: :ok
```

Like `not_to_be_in_viewport/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_ok`

```elixir
@spec not_to_be_ok(Playwright.APIResponse.t() | t(Playwright.APIResponse.t())) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_be_ok/1`: `expect(x).not.toBeOK(...)` in JS.

*Since Playwright 1.18.*

# `not_to_be_ok!`

```elixir
@spec not_to_be_ok!(Playwright.APIResponse.t() | t(Playwright.APIResponse.t())) :: :ok
```

Like `not_to_be_ok/1`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_be_visible`

```elixir
@spec not_to_be_visible(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_visible_options()
) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_be_visible/2`: `expect(x).not.toBeVisible(...)` in JS.

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:visible` (`t:boolean/0`) - *Since Playwright 1.26.*

# `not_to_be_visible!`

```elixir
@spec not_to_be_visible!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  not_to_be_visible_options()
) :: :ok
```

Like `not_to_be_visible/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_contain_class`

```elixir
@spec not_to_contain_class(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | [String.t()],
  not_to_contain_class_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_contain_class/3`: `expect(x).not.toContainClass(...)` in JS.

*Since Playwright 1.52.*

## Arguments

* `expected` - A string containing expected class names, separated by spaces, or a list of such strings to assert multiple elements.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_contain_class!`

```elixir
@spec not_to_contain_class!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | [String.t()],
  not_to_contain_class_options()
) :: :ok
```

Like `not_to_contain_class/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_contain_text`

```elixir
@spec not_to_contain_text(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_contain_text_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_contain_text/3`: `expect(x).not.toContainText(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `expected` - Expected substring or RegExp or a list of those.

## Options

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.23.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:use_inner_text` (`t:boolean/0`) - Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.

# `not_to_contain_text!`

```elixir
@spec not_to_contain_text!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_contain_text_options()
) :: :ok
```

Like `not_to_contain_text/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_accessible_description`

```elixir
@spec not_to_have_accessible_description(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_accessible_description_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_accessible_description/3`: `expect(x).not.toHaveAccessibleDescription(...)` in JS.

*Since Playwright 1.44.*

## Arguments

* `description` - Expected accessible description.

## Options

* `:ignore_case` (`t:boolean/0`) - Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_accessible_description!`

```elixir
@spec not_to_have_accessible_description!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_accessible_description_options()
) :: :ok
```

Like `not_to_have_accessible_description/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_accessible_error_message`

```elixir
@spec not_to_have_accessible_error_message(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_accessible_error_message_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_accessible_error_message/3`: `expect(x).not.toHaveAccessibleErrorMessage(...)` in JS.

*Since Playwright 1.50.*

## Arguments

* `error_message` - Expected accessible error message.

## Options

* `:ignore_case` (`t:boolean/0`) - Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_accessible_error_message!`

```elixir
@spec not_to_have_accessible_error_message!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_accessible_error_message_options()
) :: :ok
```

Like `not_to_have_accessible_error_message/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_accessible_name`

```elixir
@spec not_to_have_accessible_name(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_accessible_name_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_accessible_name/3`: `expect(x).not.toHaveAccessibleName(...)` in JS.

*Since Playwright 1.44.*

## Arguments

* `name` - Expected accessible name.

## Options

* `:ignore_case` (`t:boolean/0`) - Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_accessible_name!`

```elixir
@spec not_to_have_accessible_name!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_accessible_name_options()
) :: :ok
```

Like `not_to_have_accessible_name/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_attribute`

```elixir
@spec not_to_have_attribute(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t() | nil,
  not_to_have_attribute_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_attribute/4`: `expect(x).not.toHaveAttribute(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `name` - Attribute name.
* `value` - Expected attribute value.

## Options

The options may take the place of `value`, which is then `nil`.

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.40.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_attribute!`

```elixir
@spec not_to_have_attribute!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t() | nil,
  not_to_have_attribute_options()
) :: :ok
```

Like `not_to_have_attribute/4`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_class`

```elixir
@spec not_to_have_class(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_have_class_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_class/3`: `expect(x).not.toHaveClass(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `expected` - Expected class or RegExp or a list of those.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_class!`

```elixir
@spec not_to_have_class!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_have_class_options()
) :: :ok
```

Like `not_to_have_class/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_count`

```elixir
@spec not_to_have_count(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  integer(),
  not_to_have_count_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_count/3`: `expect(x).not.toHaveCount(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `count` - Expected count.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_count!`

```elixir
@spec not_to_have_count!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  integer(),
  not_to_have_count_options()
) :: :ok
```

Like `not_to_have_count/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_css`

```elixir
@spec not_to_have_css(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_css_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_css/4`: `expect(x).not.toHaveCSS(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `name` - CSS property name.
* `value` - CSS property value.

## Options

* `:pseudo` (`:before` | `:after`) - *Since Playwright 1.60.* Pseudo-element to read computed styles from.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_css!`

```elixir
@spec not_to_have_css!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_css_options()
) :: :ok
```

Like `not_to_have_css/4`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_id`

```elixir
@spec not_to_have_id(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_id_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_id/3`: `expect(x).not.toHaveId(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `id` - Element id.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_id!`

```elixir
@spec not_to_have_id!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_id_options()
) :: :ok
```

Like `not_to_have_id/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_js_property`

```elixir
@spec not_to_have_js_property(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  term(),
  not_to_have_js_property_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_js_property/4`: `expect(x).not.toHaveJSProperty(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `name` - Property name.
* `value` - Property value.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_js_property!`

```elixir
@spec not_to_have_js_property!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  term(),
  not_to_have_js_property_options()
) :: :ok
```

Like `not_to_have_js_property/4`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_role`

```elixir
@spec not_to_have_role(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  :alert
  | :alertdialog
  | :application
  | :article
  | :banner
  | :blockquote
  | :button
  | :caption
  | :cell
  | :checkbox
  | :code
  | :columnheader
  | :combobox
  | :complementary
  | :contentinfo
  | :definition
  | :deletion
  | :dialog
  | :directory
  | :document
  | :emphasis
  | :feed
  | :figure
  | :form
  | :generic
  | :grid
  | :gridcell
  | :group
  | :heading
  | :img
  | :insertion
  | :link
  | :list
  | :listbox
  | :listitem
  | :log
  | :main
  | :marquee
  | :math
  | :meter
  | :menu
  | :menubar
  | :menuitem
  | :menuitemcheckbox
  | :menuitemradio
  | :navigation
  | :none
  | :note
  | :option
  | :paragraph
  | :presentation
  | :progressbar
  | :radio
  | :radiogroup
  | :region
  | :row
  | :rowgroup
  | :rowheader
  | :scrollbar
  | :search
  | :searchbox
  | :separator
  | :slider
  | :spinbutton
  | :status
  | :strong
  | :subscript
  | :superscript
  | :switch
  | :tab
  | :table
  | :tablist
  | :tabpanel
  | :term
  | :textbox
  | :time
  | :timer
  | :toolbar
  | :tooltip
  | :tree
  | :treegrid
  | :treeitem
  | String.t(),
  not_to_have_role_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_role/3`: `expect(x).not.toHaveRole(...)` in JS.

*Since Playwright 1.44.*

## Arguments

* `role` - Required aria role.

  In Elixir, a role is an atom of the typespec (`:button`) or a string, also one the typespec lacks (`"mark"`): the JS client takes any string.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_role!`

```elixir
@spec not_to_have_role!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  :alert
  | :alertdialog
  | :application
  | :article
  | :banner
  | :blockquote
  | :button
  | :caption
  | :cell
  | :checkbox
  | :code
  | :columnheader
  | :combobox
  | :complementary
  | :contentinfo
  | :definition
  | :deletion
  | :dialog
  | :directory
  | :document
  | :emphasis
  | :feed
  | :figure
  | :form
  | :generic
  | :grid
  | :gridcell
  | :group
  | :heading
  | :img
  | :insertion
  | :link
  | :list
  | :listbox
  | :listitem
  | :log
  | :main
  | :marquee
  | :math
  | :meter
  | :menu
  | :menubar
  | :menuitem
  | :menuitemcheckbox
  | :menuitemradio
  | :navigation
  | :none
  | :note
  | :option
  | :paragraph
  | :presentation
  | :progressbar
  | :radio
  | :radiogroup
  | :region
  | :row
  | :rowgroup
  | :rowheader
  | :scrollbar
  | :search
  | :searchbox
  | :separator
  | :slider
  | :spinbutton
  | :status
  | :strong
  | :subscript
  | :superscript
  | :switch
  | :tab
  | :table
  | :tablist
  | :tabpanel
  | :term
  | :textbox
  | :time
  | :timer
  | :toolbar
  | :tooltip
  | :tree
  | :treegrid
  | :treeitem
  | String.t(),
  not_to_have_role_options()
) :: :ok
```

Like `not_to_have_role/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_screenshot`

```elixir
@spec not_to_have_screenshot(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  not_to_have_screenshot_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_screenshot/2`: `expect(x).not.toHaveScreenshot(...)` in JS.

*Since Playwright 1.23.*

## Options

* `:name` (`t:String.t/0` | list of `t:String.t/0`) - Snapshot name. Must have a `.png` or `.webp` extension, the screenshot is captured in the corresponding format. Both formats are lossless.

  In Elixir, a test of `Playwright.Test` resolves it to a file (see "Snapshots" in its docs), and with neither `:name` nor `:path` names the snapshot after the test. On failure the `-actual`, `-expected`, `-previous` and `-diff` images are written to the test's output dir.
* `:path` (`t:String.t/0`) - The snapshot file, in place of `:name`, required outside a `Playwright.Test` test. Must have a `.png` or `.webp` extension. A missing snapshot is written (see `:update_snapshots` in the configuration of `Playwright.Expect`); on failure the `-actual`, `-expected`, `-previous` and `-diff` images are written next to it.
* `:animations` (`:disabled` | `:allow`) - When set to `:disabled`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:

  * finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
  * infinite animations are canceled to initial state, and then played over after the screenshot.

  Defaults to `:disabled` that disables animations.
* `:caret` (`:hide` | `:initial`) - When set to `:hide`, screenshot will hide text caret. When set to `:initial`, text caret behavior will not be changed.  Defaults to `:hide`.
* `:mask` (list of `t:Playwright.Locator.t/0`) - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with
  a pink box `#FF00FF` (customized by `:mask_color`) that completely covers its bounding box.
  The mask is also applied to invisible elements, see [Matching only visible elements](https://playwright.dev/docs/locators#matching-only-visible-elements) to disable that.
* `:mask_color` (`t:String.t/0`) - *Since Playwright 1.35.* Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.
* `:max_diff_pixel_ratio` (`t:number/0`) - An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Note that `:threshold` defines which pixels are considered different.
* `:max_diff_pixels` (`t:integer/0`) - An acceptable amount of pixels that could be different. Default is configurable with `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Note that `:threshold` defines which pixels are considered different.
* `:omit_background` (`t:boolean/0`) - Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.
  Defaults to `false`.
* `:scale` (`:css` | `:device`) - When set to `:css`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `:device` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger.

  Defaults to `:css`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:style_path` (`t:String.t/0` | list of `t:String.t/0`) - *Since Playwright 1.41.* File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies to the inner frames.
* `:threshold` (`t:number/0`) - An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)
  between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with
  `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Defaults to `0.2`.
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect, to_have_screenshot: [...]`, else to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:clip` (`t:map/0`) - An object which specifies clipping of the resulting image.
  * `:x` - x-coordinate of top-left corner of clip area
  * `:y` - y-coordinate of top-left corner of clip area
  * `:width` - width of clipping area
  * `:height` - height of clipping area
* `:full_page` (`t:boolean/0`) - When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to
  `false`.

# `not_to_have_screenshot!`

```elixir
@spec not_to_have_screenshot!(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  not_to_have_screenshot_options()
) :: :ok
```

Like `not_to_have_screenshot/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_text`

```elixir
@spec not_to_have_text(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_have_text_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_text/3`: `expect(x).not.toHaveText(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `expected` - Expected string or RegExp or a list of those.

## Options

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.23.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:use_inner_text` (`t:boolean/0`) - Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.

# `not_to_have_text!`

```elixir
@spec not_to_have_text!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_have_text_options()
) :: :ok
```

Like `not_to_have_text/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_title`

```elixir
@spec not_to_have_title(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_title_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_title/3`: `expect(x).not.toHaveTitle(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `title_or_reg_exp` - Expected title or RegExp.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_title!`

```elixir
@spec not_to_have_title!(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_title_options()
) :: :ok
```

Like `not_to_have_title/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_url`

```elixir
@spec not_to_have_url(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
  not_to_have_url_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_url/3`: `expect(x).not.toHaveURL(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `url` - Expected URL string, RegExp, or predicate receiving `URI` to match.
  When `:base_url` is provided via the context options and the `url` argument is a string, the two values are merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor and used for the comparison against the current browser URL.

## Options

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.44.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression parameter if specified. A provided predicate ignores this flag.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_url!`

```elixir
@spec not_to_have_url!(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
  not_to_have_url_options()
) :: :ok
```

Like `not_to_have_url/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_value`

```elixir
@spec not_to_have_value(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_value_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_value/3`: `expect(x).not.toHaveValue(...)` in JS.

*Since Playwright 1.20.*

## Arguments

* `value` - Expected value.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_value!`

```elixir
@spec not_to_have_value!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  not_to_have_value_options()
) :: :ok
```

Like `not_to_have_value/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_have_values`

```elixir
@spec not_to_have_values(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_have_values_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_have_values/3`: `expect(x).not.toHaveValues(...)` in JS.

*Since Playwright 1.23.*

## Arguments

* `values` - Expected options currently selected.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_have_values!`

```elixir
@spec not_to_have_values!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  [String.t() | Regex.t() | Playwright.RegExp.t()],
  not_to_have_values_options()
) :: :ok
```

Like `not_to_have_values/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_match_aria_snapshot`

```elixir
@spec not_to_match_aria_snapshot(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  String.t() | nil,
  not_to_match_aria_snapshot_options()
) :: :ok | {:error, Playwright.error()}
```

The opposite of `to_match_aria_snapshot/3`: `expect(x).not.toMatchAriaSnapshot(...)` in JS.

*Since Playwright 1.49.*

## Options

The options may take the place of `expected`, which is then `nil`.

* `:name` (`t:String.t/0`) - Name of the snapshot to store in the snapshot folder corresponding to this test. Generates sequential names if not specified.

  In Elixir, in place of `expected`: a test of `Playwright.Test` resolves it to a file (see "Snapshots" in its docs), and with neither `expected`, `:name` nor `:path` names the snapshot after the test.
* `:path` (`t:String.t/0`) - The snapshot file, in place of `expected` or `:name`. Its content is the expected snapshot. A missing snapshot is written, unless `:update_snapshots` is `:none` or the matcher is negated. With `:update_snapshots` set to `:all` it is always rewritten, with `:changed` when it differs (see the configuration of `Playwright.Expect`).
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_match_aria_snapshot!`

```elixir
@spec not_to_match_aria_snapshot!(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  String.t() | nil,
  not_to_match_aria_snapshot_options()
) :: :ok
```

Like `not_to_match_aria_snapshot/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `not_to_pass`

```elixir
@spec not_to_pass((-&gt; term()) | t((-&gt; term())), not_to_pass_options()) ::
  :ok | {:error, Playwright.error()}
```

The opposite of `to_pass/2`: `expect(x).not.toPass(...)` in JS.

*Since Playwright 1.29.*

## Options

* `:intervals` (list of `t:integer/0`) - Probe, wait 1s, probe, wait 2s, probe, wait 10s, probe, wait 10s, probe: `[1_000, 2_000, 10_000]`. Defaults to `[100, 250, 500, 1000]`.
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the callback for in milliseconds. Defaults to `0`: until the test's timeout (none outside a `Playwright.Test` test), not the matchers' `:timeout`. A default other than `0` is `:to_pass` in `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Within a test, it ends before the test's timeout.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `not_to_pass!`

```elixir
@spec not_to_pass!((-&gt; term()) | t((-&gt; term())), not_to_pass_options()) :: :ok
```

Like `not_to_pass/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `poll`

```elixir
@spec poll((-&gt; term()) | t((-&gt; term())), (term() -&gt; term()), poll_options()) ::
  :ok | {:error, Playwright.error()}
```

You can convert any synchronous `expect` to an asynchronous polling one using `Playwright.Expect.poll/3`.

The following method will poll given function until it returns HTTP status 200:

```elixir
Expect.poll!(
  fn ->
    response = page |> Page.request() |> APIRequestContext.get!("https://api.example.com")
    APIResponse.status(response)
  end,
  &assert(&1 == 200),
  # Custom expect message for reporting, optional.
  message: "make sure API eventually succeeds",
  # Poll for 10 seconds; defaults to 5 seconds. Pass 0 to disable timeout.
  timeout: 10_000
)
```

You can also specify custom polling intervals:

```elixir
Expect.poll!(
  fn ->
    response = page |> Page.request() |> APIRequestContext.get!("https://api.example.com")
    APIResponse.status(response)
  end,
  &assert(&1 == 200),
  # Probe, wait 1s, probe, wait 2s, probe, wait 10s, probe, wait 10s, probe
  # ... Defaults to [100, 250, 500, 1000].
  intervals: [1_000, 2_000, 10_000],
  timeout: 60_000
)
```

You can combine `Playwright.Expect.soft/1` with `Playwright.Expect.poll/3` to perform soft assertions in polling logic. This allows the test to continue even if the assertion inside poll fails.

```elixir
fn ->
  response = page |> Page.request() |> APIRequestContext.get!("https://api.example.com")
  APIResponse.status(response)
end
|> Expect.soft()
|> Expect.poll!(&assert(&1 == 200))
```

In Elixir, the jest matcher is an `assertion` of the value, as Elixir's generic assertions are ExUnit's. `callback` raising fails the poll at once, as upstream's; the assertion raising is retried, and its last error is in the timeout's message. Both run in the calling process. Negate in the assertion (`&refute(&1 == 200)`): a negated receiver raises `ArgumentError`.

*Since Playwright 1.21.*

## Arguments

* `assertion` - Called with each value of `callback`, the place of a jest matcher (`.toBe(200)`): an ExUnit assertion (`&assert(&1 == 200)`), which raises until the value is right.

## Options

* `:intervals` (list of `t:integer/0`) - Probe, wait 1s, probe, wait 2s, probe, wait 10s, probe, wait 10s, probe: `[1_000, 2_000, 10_000]`. Defaults to `[100, 250, 500, 1000]`.
* `:message` (`t:String.t/0`) - A custom expect message, for the step title and the error.
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `poll!`

```elixir
@spec poll!((-&gt; term()) | t((-&gt; term())), (term() -&gt; term()), poll_options()) :: :ok
```

Like `poll/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `soft`

```elixir
@spec soft(actual | t(actual)) :: t(actual)
when actual:
       Playwright.Locator.t()
       | Playwright.Page.t()
       | Playwright.APIResponse.t()
       | (-&gt; term())
```

By default, failed assertion will terminate test execution. Playwright also supports *soft assertions*: failed soft assertions **do not** terminate test execution, but mark the test as failed.

```elixir
# Make a few checks that will not stop the test when failed...
Page.get_by_test_id(page, "status") |> Expect.soft() |> Expect.to_have_text!("Success")
Page.get_by_test_id(page, "eta") |> Expect.soft() |> Expect.to_have_text!("1 day")

# ... and continue the test to check more things.
Page.get_by_role(page, :link, name: "next page") |> Locator.click!()
Page.get_by_role(page, :heading, name: "Make another order") |> Expect.soft() |> Expect.to_be_visible!()
```

Note that soft assertions only work with Playwright test runner.

In Elixir, `soft/1` wraps the receiver as `not_/1` does, in either order: `locator |> Expect.soft() |> Expect.not_()` is `expect.soft(locator).not`, and the `not_to_*` matchers take a soft receiver too. In a `Playwright.Test` test, a failed soft matcher returns `:ok` (the bang form too) and the test fails at the end of its body with all its errors. Outside such a test it fails as any matcher.

# `to_be_attached`

```elixir
@spec to_be_attached(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_attached_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures that [`Locator`](`Playwright.Locator`) points to an element that is [connected](https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected) to a Document or a ShadowRoot.

**Usage**

```elixir
Page.get_by_text(page, "Hidden text") |> Expect.to_be_attached!()
```

*Since Playwright 1.33.*

## Options

* `:attached` (`t:boolean/0`)
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_attached!`

```elixir
@spec to_be_attached!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_attached_options()
) ::
  :ok
```

Like `to_be_attached/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_checked`

```elixir
@spec to_be_checked(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_checked_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to a checked input.

**Usage**

```elixir
locator = Page.get_by_label(page, "Subscribe to newsletter")
Expect.to_be_checked!(locator)
```

*Since Playwright 1.20.*

## Options

* `:checked` (`t:boolean/0`) - Provides state to assert for. Asserts for input to be checked by default.
  This option can't be used when `:indeterminate` is set to true.
* `:indeterminate` (`t:boolean/0`) - *Since Playwright 1.50.* Asserts that the element is in the indeterminate (mixed) state. Only supported for checkboxes and radio buttons.
  This option can't be true when `:checked` is provided.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_checked!`

```elixir
@spec to_be_checked!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_checked_options()
) :: :ok
```

Like `to_be_checked/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_disabled`

```elixir
@spec to_be_disabled(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_disabled_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to a disabled element. Element is disabled if it has "disabled" attribute
or is disabled via ['aria-disabled'](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-disabled).
Note that only native control elements such as HTML `button`, `input`, `select`, `textarea`, `option`, `optgroup`
can be disabled by setting "disabled" attribute. "disabled" attribute on other elements is ignored
by the browser.

**Usage**

```elixir
locator = Page.locator(page, "button.submit")
Expect.to_be_disabled!(locator)
```

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_disabled!`

```elixir
@spec to_be_disabled!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_disabled_options()
) ::
  :ok
```

Like `to_be_disabled/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_editable`

```elixir
@spec to_be_editable(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_editable_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an editable element.

**Usage**

```elixir
locator = Page.get_by_role(page, :textbox)
Expect.to_be_editable!(locator)
```

*Since Playwright 1.20.*

## Options

* `:editable` (`t:boolean/0`) - *Since Playwright 1.26.*
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_editable!`

```elixir
@spec to_be_editable!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_editable_options()
) ::
  :ok
```

Like `to_be_editable/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_empty`

```elixir
@spec to_be_empty(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_empty_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an empty editable element or to a DOM node that has no text.

**Usage**

```elixir
locator = Page.locator(page, "div.warning")
Expect.to_be_empty!(locator)
```

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_empty!`

```elixir
@spec to_be_empty!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_empty_options()
) :: :ok
```

Like `to_be_empty/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_enabled`

```elixir
@spec to_be_enabled(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_enabled_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an enabled element.

**Usage**

```elixir
locator = Page.locator(page, "button.submit")
Expect.to_be_enabled!(locator)
```

*Since Playwright 1.20.*

## Options

* `:enabled` (`t:boolean/0`) - *Since Playwright 1.26.*
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_enabled!`

```elixir
@spec to_be_enabled!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_enabled_options()
) :: :ok
```

Like `to_be_enabled/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_focused`

```elixir
@spec to_be_focused(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_focused_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to a focused DOM node.

**Usage**

```elixir
locator = Page.get_by_role(page, :textbox)
Expect.to_be_focused!(locator)
```

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_focused!`

```elixir
@spec to_be_focused!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_focused_options()
) :: :ok
```

Like `to_be_focused/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_hidden`

```elixir
@spec to_be_hidden(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_hidden_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures that [`Locator`](`Playwright.Locator`) either does not resolve to any DOM node, or resolves to a [non-visible](https://playwright.dev/docs/actionability#visible) one.

**Usage**

```elixir
locator = Page.locator(page, ".my-element")
Expect.to_be_hidden!(locator)
```

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_hidden!`

```elixir
@spec to_be_hidden!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_hidden_options()
) :: :ok
```

Like `to_be_hidden/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_in_viewport`

```elixir
@spec to_be_in_viewport(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_in_viewport_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element that intersects viewport, according to the [intersection observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).

**Usage**

```elixir
locator = Page.get_by_role(page, :button)
# Make sure at least some part of element intersects viewport.
Expect.to_be_in_viewport!(locator)
# Make sure element is fully outside of viewport.
Expect.not_to_be_in_viewport!(locator)
# Make sure that at least half of the element intersects viewport.
Expect.to_be_in_viewport!(locator, ratio: 0.5)
```

*Since Playwright 1.31.*

## Options

* `:ratio` (`t:number/0`) - The minimal ratio of the element to intersect viewport. If equals to `0`, then
  element should intersect viewport at any positive ratio. Defaults to `0`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_be_in_viewport!`

```elixir
@spec to_be_in_viewport!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_in_viewport_options()
) :: :ok
```

Like `to_be_in_viewport/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_ok`

```elixir
@spec to_be_ok(Playwright.APIResponse.t() | t(Playwright.APIResponse.t())) ::
  :ok | {:error, Playwright.error()}
```

Ensures the response status code is within `200..299` range.

**Usage**

```elixir
Expect.to_be_ok!(response)
```

*Since Playwright 1.18.*

# `to_be_ok!`

```elixir
@spec to_be_ok!(Playwright.APIResponse.t() | t(Playwright.APIResponse.t())) :: :ok
```

Like `to_be_ok/1`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_be_visible`

```elixir
@spec to_be_visible(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_visible_options()
) ::
  :ok | {:error, Playwright.error()}
```

Ensures that [`Locator`](`Playwright.Locator`) points to an attached and [visible](https://playwright.dev/docs/actionability#visible) DOM node.

To check that at least one element from the list is visible, use `Playwright.Locator.first/1`.

**Usage**

```elixir
# A specific element is visible.
Page.get_by_text(page, "Welcome") |> Expect.to_be_visible!()

# At least one item in the list is visible.
Page.get_by_test_id(page, "todo-item") |> Locator.first() |> Expect.to_be_visible!()

# At least one of the two elements is visible, possibly both.
Page.get_by_role(page, :button, name: "Sign in")
|> Locator.or_(Page.get_by_role(page, :button, name: "Sign up"))
|> Locator.first()
|> Expect.to_be_visible!()
```

*Since Playwright 1.20.*

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:visible` (`t:boolean/0`) - *Since Playwright 1.26.*

# `to_be_visible!`

```elixir
@spec to_be_visible!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  to_be_visible_options()
) :: :ok
```

Like `to_be_visible/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_contain_class`

```elixir
@spec to_contain_class(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | [String.t()],
  to_contain_class_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with given CSS classes. All classes from the asserted value, separated by spaces, must be present in the [Element.classList](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList) in any order.

**Usage**

```html
<div class='middle selected row' id='component'></div>
```

```elixir
locator = Page.locator(page, "#component")
Expect.to_contain_class!(locator, "middle selected row")
Expect.to_contain_class!(locator, "selected")
Expect.to_contain_class!(locator, "row middle")
```

When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class lists. Each element's class attribute is matched against the corresponding class in the array:

```html
<div class='list'>
  <div class='component inactive'></div>
  <div class='component active'></div>
  <div class='component inactive'></div>
</div>
```

```elixir
locator = Page.locator(page, ".list > .component")
Expect.to_contain_class!(locator, ["inactive", "active", "inactive"])
```

*Since Playwright 1.52.*

## Arguments

* `expected` - A string containing expected class names, separated by spaces, or a list of such strings to assert multiple elements.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_contain_class!`

```elixir
@spec to_contain_class!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | [String.t()],
  to_contain_class_options()
) :: :ok
```

Like `to_contain_class/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_contain_text`

```elixir
@spec to_contain_text(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_contain_text_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element that contains the given text. All nested elements will be considered when computing the text content of the element. You can use regular expressions for the value as well.

**Details**

When `expected` parameter is a string, Playwright will normalize whitespaces and line breaks both in the actual text and
in the expected string before matching. When regular expression is used, the actual text is matched as is.

**Usage**

```elixir
locator = Page.locator(page, ".title")
Expect.to_contain_text!(locator, "substring")
Expect.to_contain_text!(locator, ~r/\d messages/)
```

If you pass an array as an expected value, the expectations are:

1. Locator resolves to a list of elements.
1. Elements from a **subset** of this list contain text from the expected array, respectively.
1. The matching subset of elements has the same order as the expected array.
1. Each text value from the expected array is matched by some element from the list.

For example, consider the following list:

```html
<ul>
  <li>Item Text 1</li>
  <li>Item Text 2</li>
  <li>Item Text 3</li>
</ul>
```

Let's see how we can use the assertion:

```elixir
# ✓ Contains the right items in the right order
Page.locator(page, "ul > li") |> Expect.to_contain_text!(["Text 1", "Text 3"])

# ✖ Wrong order
{:error, _} = Page.locator(page, "ul > li") |> Expect.to_contain_text(["Text 3", "Text 2"])

# ✖ No item contains this text
{:error, _} = Page.locator(page, "ul > li") |> Expect.to_contain_text(["Some 33"])

# ✖ Locator points to the outer list element, not to the list items
# (in fact it passes: the list's text contains "Text 3")
:ok = Page.locator(page, "ul") |> Expect.to_contain_text(["Text 3"])
```

*Since Playwright 1.20.*

## Arguments

* `expected` - Expected substring or RegExp or a list of those.

## Options

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.23.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:use_inner_text` (`t:boolean/0`) - Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.

# `to_contain_text!`

```elixir
@spec to_contain_text!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_contain_text_options()
) :: :ok
```

Like `to_contain_text/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_accessible_description`

```elixir
@spec to_have_accessible_description(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_accessible_description_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with a given [accessible description](https://w3c.github.io/accname/#dfn-accessible-description).

**Usage**

```elixir
locator = Page.get_by_test_id(page, "save-button")
Expect.to_have_accessible_description!(locator, "Save results to disk")
```

*Since Playwright 1.44.*

## Arguments

* `description` - Expected accessible description.

## Options

* `:ignore_case` (`t:boolean/0`) - Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_accessible_description!`

```elixir
@spec to_have_accessible_description!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_accessible_description_options()
) :: :ok
```

Like `to_have_accessible_description/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_accessible_error_message`

```elixir
@spec to_have_accessible_error_message(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_accessible_error_message_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with a given [aria errormessage](https://w3c.github.io/aria/#aria-errormessage).

**Usage**

```elixir
locator = Page.get_by_test_id(page, "username-input")
Expect.to_have_accessible_error_message!(locator, "Username is required.")
```

*Since Playwright 1.50.*

## Arguments

* `error_message` - Expected accessible error message.

## Options

* `:ignore_case` (`t:boolean/0`) - Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_accessible_error_message!`

```elixir
@spec to_have_accessible_error_message!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_accessible_error_message_options()
) :: :ok
```

Like `to_have_accessible_error_message/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_accessible_name`

```elixir
@spec to_have_accessible_name(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_accessible_name_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with a given [accessible name](https://w3c.github.io/accname/#dfn-accessible-name).

**Usage**

```elixir
locator = Page.get_by_test_id(page, "save-button")
Expect.to_have_accessible_name!(locator, "Save to disk")
```

*Since Playwright 1.44.*

## Arguments

* `name` - Expected accessible name.

## Options

* `:ignore_case` (`t:boolean/0`) - Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_accessible_name!`

```elixir
@spec to_have_accessible_name!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_accessible_name_options()
) :: :ok
```

Like `to_have_accessible_name/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_attribute`

```elixir
@spec to_have_attribute(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t() | nil,
  to_have_attribute_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with given attribute.

**Usage**

```elixir
locator = Page.locator(page, "input")
Expect.to_have_attribute!(locator, "type", "text")
```

```elixir
locator = Page.locator(page, "input")
# Assert attribute existence.
Expect.to_have_attribute!(locator, "disabled")
Expect.not_to_have_attribute!(locator, "open")
```

*Since Playwright 1.20.*

## Arguments

* `name` - Attribute name.
* `value` - Expected attribute value.

## Options

The options may take the place of `value`, which is then `nil`.

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.40.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_attribute!`

```elixir
@spec to_have_attribute!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t() | nil,
  to_have_attribute_options()
) :: :ok
```

Like `to_have_attribute/4`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_class`

```elixir
@spec to_have_class(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_have_class_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with given CSS classes. When a string is provided, it must fully match the element's `class` attribute. To match individual classes use `Playwright.Expect.to_contain_class/3`.

**Usage**

```html
<div class='middle selected row' id='component'></div>
```

```elixir
locator = Page.locator(page, "#component")
Expect.to_have_class!(locator, "middle selected row")
Expect.to_have_class!(locator, ~r/(^|\s)selected(\s|$)/)
```

When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class values. Each element's class attribute is matched against the corresponding string or regular expression in the array:

```elixir
locator = Page.locator(page, ".list > .component")
Expect.to_have_class!(locator, ["component", "component selected", "component"])
```

*Since Playwright 1.20.*

## Arguments

* `expected` - Expected class or RegExp or a list of those.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_class!`

```elixir
@spec to_have_class!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_have_class_options()
) :: :ok
```

Like `to_have_class/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_count`

```elixir
@spec to_have_count(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  integer(),
  to_have_count_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) resolves to an exact number of DOM nodes.

**Usage**

```elixir
list = Page.locator(page, "list > .component")
Expect.to_have_count!(list, 3)
```

*Since Playwright 1.20.*

## Arguments

* `count` - Expected count.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_count!`

```elixir
@spec to_have_count!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  integer(),
  to_have_count_options()
) :: :ok
```

Like `to_have_count/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_css`

```elixir
@spec to_have_css(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_css_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) resolves to an element with the given computed CSS style.

**Usage**

```elixir
locator = Page.get_by_role(page, :button)
Expect.to_have_css!(locator, "display", "flex")
```

*Since Playwright 1.20.*

## Arguments

* `name` - CSS property name.
* `value` - CSS property value.

## Options

* `:pseudo` (`:before` | `:after`) - *Since Playwright 1.60.* Pseudo-element to read computed styles from.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_css!`

```elixir
@spec to_have_css!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_css_options()
) :: :ok
```

Like `to_have_css/4`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_id`

```elixir
@spec to_have_id(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_id_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with the given DOM Node ID.

**Usage**

```elixir
locator = Page.get_by_role(page, :textbox)
Expect.to_have_id!(locator, "lastname")
```

*Since Playwright 1.20.*

## Arguments

* `id` - Element id.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_id!`

```elixir
@spec to_have_id!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_id_options()
) :: :ok
```

Like `to_have_id/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_js_property`

```elixir
@spec to_have_js_property(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  term(),
  to_have_js_property_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with given JavaScript property. Note that this property can be
of a primitive type as well as a plain serializable JavaScript object.

**Usage**

```elixir
locator = Page.locator(page, ".component")
Expect.to_have_js_property!(locator, "loaded", true)
```

*Since Playwright 1.20.*

## Arguments

* `name` - Property name.
* `value` - Property value.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_js_property!`

```elixir
@spec to_have_js_property!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t(),
  term(),
  to_have_js_property_options()
) :: :ok
```

Like `to_have_js_property/4`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_role`

```elixir
@spec to_have_role(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  :alert
  | :alertdialog
  | :application
  | :article
  | :banner
  | :blockquote
  | :button
  | :caption
  | :cell
  | :checkbox
  | :code
  | :columnheader
  | :combobox
  | :complementary
  | :contentinfo
  | :definition
  | :deletion
  | :dialog
  | :directory
  | :document
  | :emphasis
  | :feed
  | :figure
  | :form
  | :generic
  | :grid
  | :gridcell
  | :group
  | :heading
  | :img
  | :insertion
  | :link
  | :list
  | :listbox
  | :listitem
  | :log
  | :main
  | :marquee
  | :math
  | :meter
  | :menu
  | :menubar
  | :menuitem
  | :menuitemcheckbox
  | :menuitemradio
  | :navigation
  | :none
  | :note
  | :option
  | :paragraph
  | :presentation
  | :progressbar
  | :radio
  | :radiogroup
  | :region
  | :row
  | :rowgroup
  | :rowheader
  | :scrollbar
  | :search
  | :searchbox
  | :separator
  | :slider
  | :spinbutton
  | :status
  | :strong
  | :subscript
  | :superscript
  | :switch
  | :tab
  | :table
  | :tablist
  | :tabpanel
  | :term
  | :textbox
  | :time
  | :timer
  | :toolbar
  | :tooltip
  | :tree
  | :treegrid
  | :treeitem
  | String.t(),
  to_have_role_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with a given [ARIA role](https://www.w3.org/TR/wai-aria-1.2/#roles).

Note that role is matched as a string, disregarding the ARIA role hierarchy. For example, asserting  a superclass role `:checkbox` on an element with a subclass role `:switch` will fail.

**Usage**

```elixir
locator = Page.get_by_test_id(page, "save-button")
Expect.to_have_role!(locator, :button)
```

*Since Playwright 1.44.*

## Arguments

* `role` - Required aria role.

  In Elixir, a role is an atom of the typespec (`:button`) or a string, also one the typespec lacks (`"mark"`): the JS client takes any string.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_role!`

```elixir
@spec to_have_role!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  :alert
  | :alertdialog
  | :application
  | :article
  | :banner
  | :blockquote
  | :button
  | :caption
  | :cell
  | :checkbox
  | :code
  | :columnheader
  | :combobox
  | :complementary
  | :contentinfo
  | :definition
  | :deletion
  | :dialog
  | :directory
  | :document
  | :emphasis
  | :feed
  | :figure
  | :form
  | :generic
  | :grid
  | :gridcell
  | :group
  | :heading
  | :img
  | :insertion
  | :link
  | :list
  | :listbox
  | :listitem
  | :log
  | :main
  | :marquee
  | :math
  | :meter
  | :menu
  | :menubar
  | :menuitem
  | :menuitemcheckbox
  | :menuitemradio
  | :navigation
  | :none
  | :note
  | :option
  | :paragraph
  | :presentation
  | :progressbar
  | :radio
  | :radiogroup
  | :region
  | :row
  | :rowgroup
  | :rowheader
  | :scrollbar
  | :search
  | :searchbox
  | :separator
  | :slider
  | :spinbutton
  | :status
  | :strong
  | :subscript
  | :superscript
  | :switch
  | :tab
  | :table
  | :tablist
  | :tabpanel
  | :term
  | :textbox
  | :time
  | :timer
  | :toolbar
  | :tooltip
  | :tree
  | :treegrid
  | :treeitem
  | String.t(),
  to_have_role_options()
) :: :ok
```

Like `to_have_role/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_screenshot`

```elixir
@spec to_have_screenshot(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  to_have_screenshot_options()
) :: :ok | {:error, Playwright.error()}
```

This function will wait until two consecutive locator screenshots
yield the same result, and then compare the last screenshot with the expectation.

**Usage**

```elixir
Expect.to_have_screenshot!(page, name: "image.png")

# Outside a Playwright.Test test
Expect.to_have_screenshot!(page, path: "test/snapshots/image.png")
```

*Since Playwright 1.23.*

## Options

* `:name` (`t:String.t/0` | list of `t:String.t/0`) - Snapshot name. Must have a `.png` or `.webp` extension, the screenshot is captured in the corresponding format. Both formats are lossless.

  In Elixir, a test of `Playwright.Test` resolves it to a file (see "Snapshots" in its docs), and with neither `:name` nor `:path` names the snapshot after the test. On failure the `-actual`, `-expected`, `-previous` and `-diff` images are written to the test's output dir.
* `:path` (`t:String.t/0`) - The snapshot file, in place of `:name`, required outside a `Playwright.Test` test. Must have a `.png` or `.webp` extension. A missing snapshot is written (see `:update_snapshots` in the configuration of `Playwright.Expect`); on failure the `-actual`, `-expected`, `-previous` and `-diff` images are written next to it.
* `:animations` (`:disabled` | `:allow`) - When set to `:disabled`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:

  * finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
  * infinite animations are canceled to initial state, and then played over after the screenshot.

  Defaults to `:disabled` that disables animations.
* `:caret` (`:hide` | `:initial`) - When set to `:hide`, screenshot will hide text caret. When set to `:initial`, text caret behavior will not be changed.  Defaults to `:hide`.
* `:mask` (list of `t:Playwright.Locator.t/0`) - Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with
  a pink box `#FF00FF` (customized by `:mask_color`) that completely covers its bounding box.
  The mask is also applied to invisible elements, see [Matching only visible elements](https://playwright.dev/docs/locators#matching-only-visible-elements) to disable that.
* `:mask_color` (`t:String.t/0`) - *Since Playwright 1.35.* Specify the color of the overlay box for masked elements, in [CSS color format](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Default color is pink `#FF00FF`.
* `:max_diff_pixel_ratio` (`t:number/0`) - An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is configurable with `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Note that `:threshold` defines which pixels are considered different.
* `:max_diff_pixels` (`t:integer/0`) - An acceptable amount of pixels that could be different. Default is configurable with `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Note that `:threshold` defines which pixels are considered different.
* `:omit_background` (`t:boolean/0`) - Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.
  Defaults to `false`.
* `:scale` (`:css` | `:device`) - When set to `:css`, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will keep screenshots small. Using `:device` option will produce a single pixel per each device pixel, so screenshots of high-dpi devices will be twice as large or even larger.

  Defaults to `:css`.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:style_path` (`t:String.t/0` | list of `t:String.t/0`) - *Since Playwright 1.41.* File name containing the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM and applies to the inner frames.
* `:threshold` (`t:number/0`) - An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ)
  between the same pixel in compared images, between zero (strict) and one (lax), default is configurable with
  `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Defaults to `0.2`.
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect, to_have_screenshot: [...]`, else to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:clip` (`t:map/0`) - An object which specifies clipping of the resulting image.
  * `:x` - x-coordinate of top-left corner of clip area
  * `:y` - y-coordinate of top-left corner of clip area
  * `:width` - width of clipping area
  * `:height` - height of clipping area
* `:full_page` (`t:boolean/0`) - When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to
  `false`.

# `to_have_screenshot!`

```elixir
@spec to_have_screenshot!(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  to_have_screenshot_options()
) :: :ok
```

Like `to_have_screenshot/2`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_text`

```elixir
@spec to_have_text(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_have_text_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with the given text. All nested elements will be considered when computing the text content of the element. You can use regular expressions for the value as well.

**Details**

When `expected` parameter is a string, Playwright will normalize whitespaces and line breaks both in the actual text and
in the expected string before matching. When regular expression is used, the actual text is matched as is.

**Usage**

```elixir
locator = Page.locator(page, ".title")
Expect.to_have_text!(locator, ~r/Welcome, Test User/)
Expect.to_have_text!(locator, ~r/Welcome, .*/)
```

If you pass an array as an expected value, the expectations are:

1. Locator resolves to a list of elements.
1. The number of elements equals the number of expected values in the array.
1. Elements from the list have text matching expected array values, one by one, in order.

For example, consider the following list:

```html
<ul>
  <li>Text 1</li>
  <li>Text 2</li>
  <li>Text 3</li>
</ul>
```

Let's see how we can use the assertion:

```elixir
# ✓ Has the right items in the right order
Page.locator(page, "ul > li") |> Expect.to_have_text!(["Text 1", "Text 2", "Text 3"])

# ✖ Wrong order
{:error, _} = Page.locator(page, "ul > li") |> Expect.to_have_text(["Text 3", "Text 2", "Text 1"])

# ✖ Last item does not match
{:error, _} = Page.locator(page, "ul > li") |> Expect.to_have_text(["Text 1", "Text 2", "Text"])

# ✖ Locator points to the outer list element, not to the list items
{:error, _} = Page.locator(page, "ul") |> Expect.to_have_text(["Text 1", "Text 2", "Text 3"])
```

*Since Playwright 1.20.*

## Arguments

* `expected` - Expected string or RegExp or a list of those.

## Options

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.23.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression flag if specified.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.
* `:use_inner_text` (`t:boolean/0`) - Whether to use `element.innerText` instead of `element.textContent` when retrieving DOM node text.

# `to_have_text!`

```elixir
@spec to_have_text!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t()
  | Regex.t()
  | Playwright.RegExp.t()
  | [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_have_text_options()
) :: :ok
```

Like `to_have_text/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_title`

```elixir
@spec to_have_title(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_title_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the page has the given title.

**Usage**

```elixir
Expect.to_have_title!(page, ~r/.*checkout/)
```

*Since Playwright 1.20.*

## Arguments

* `title_or_reg_exp` - Expected title or RegExp.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_title!`

```elixir
@spec to_have_title!(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_title_options()
) :: :ok
```

Like `to_have_title/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_url`

```elixir
@spec to_have_url(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
  to_have_url_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the page is navigated to the given URL.

**Usage**

```elixir
# Check for the page URL to be 'https://playwright.dev/docs/intro' (including query string)
Expect.to_have_url!(page, "https://playwright.dev/docs/intro")

# Check for the page URL to contain 'doc', followed by an optional 's', followed by '/'
Expect.to_have_url!(page, ~r/docs?\//)

# Check for the page URL to match the URL pattern (Elixir has no URLPattern: a predicate)
Expect.to_have_url!(page, &String.starts_with?(&1.path, "/docs/"))

# Check for the predicate to be satisfied
# For example: verify query strings
Expect.to_have_url!(page, fn url ->
  params = URI.decode_query(url.query || "")
  Map.has_key?(params, "search") and Map.has_key?(params, "options") and params["id"] == "5"
end)
```

*Since Playwright 1.20.*

## Arguments

* `url` - Expected URL string, RegExp, or predicate receiving `URI` to match.
  When `:base_url` is provided via the context options and the `url` argument is a string, the two values are merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor and used for the comparison against the current browser URL.

## Options

* `:ignore_case` (`t:boolean/0`) - *Since Playwright 1.44.* Whether to perform case-insensitive match. `:ignore_case` option takes precedence over the corresponding regular expression parameter if specified. A provided predicate ignores this flag.
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_url!`

```elixir
@spec to_have_url!(
  Playwright.Page.t() | t(Playwright.Page.t()),
  String.t() | Regex.t() | Playwright.RegExp.t() | (URI.t() -&gt; boolean()),
  to_have_url_options()
) :: :ok
```

Like `to_have_url/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_value`

```elixir
@spec to_have_value(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_value_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to an element with the given input value. You can use regular expressions for the value as well.

**Usage**

```elixir
locator = Page.locator(page, "input[type=number]")
Expect.to_have_value!(locator, ~r/[0-9]/)
```

*Since Playwright 1.20.*

## Arguments

* `value` - Expected value.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_value!`

```elixir
@spec to_have_value!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  String.t() | Regex.t() | Playwright.RegExp.t(),
  to_have_value_options()
) :: :ok
```

Like `to_have_value/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_have_values`

```elixir
@spec to_have_values(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_have_values_options()
) :: :ok | {:error, Playwright.error()}
```

Ensures the [`Locator`](`Playwright.Locator`) points to multi-select/combobox (i.e. a `select` with the `multiple` attribute) and the specified values are selected.

**Usage**

For example, given the following element:

```html
<select id="favorite-colors" multiple>
  <option value="R">Red</option>
  <option value="G">Green</option>
  <option value="B">Blue</option>
</select>
```

```elixir
locator = Page.locator(page, "id=favorite-colors")
Locator.select_option!(locator, ["R", "G"])
Expect.to_have_values!(locator, [~r/R/, ~r/G/])
```

*Since Playwright 1.23.*

## Arguments

* `values` - Expected options currently selected.

## Options

* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_have_values!`

```elixir
@spec to_have_values!(
  Playwright.Locator.t() | t(Playwright.Locator.t()),
  [String.t() | Regex.t() | Playwright.RegExp.t()],
  to_have_values_options()
) :: :ok
```

Like `to_have_values/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_match_aria_snapshot`

```elixir
@spec to_match_aria_snapshot(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  String.t() | nil,
  to_match_aria_snapshot_options()
) :: :ok | {:error, Playwright.error()}
```

Asserts that the target element matches the given [accessibility snapshot](https://playwright.dev/docs/aria-snapshots).

**Usage**

```elixir
Page.goto!(page, "https://demo.playwright.dev/todomvc/")

Page.locator(page, "body")
|> Expect.to_match_aria_snapshot!("""
- heading "todos"
- textbox "What needs to be done?"
""")
```

```elixir
Expect.to_match_aria_snapshot!(page, name: "body.aria.yml")

# Outside a Playwright.Test test
Expect.to_match_aria_snapshot!(page, path: "test/snapshots/body.aria.yml")
```

*Since Playwright 1.49.*

## Options

The options may take the place of `expected`, which is then `nil`.

* `:name` (`t:String.t/0`) - Name of the snapshot to store in the snapshot folder corresponding to this test. Generates sequential names if not specified.

  In Elixir, in place of `expected`: a test of `Playwright.Test` resolves it to a file (see "Snapshots" in its docs), and with neither `expected`, `:name` nor `:path` names the snapshot after the test.
* `:path` (`t:String.t/0`) - The snapshot file, in place of `expected` or `:name`. Its content is the expected snapshot. A missing snapshot is written, unless `:update_snapshots` is `:none` or the matcher is negated. With `:update_snapshots` set to `:all` it is always rewritten, with `:changed` when it differs (see the configuration of `Playwright.Expect`).
* `:signal` (`t:Playwright.AbortSignal.t/0`) - *Since Playwright 1.62.* An optional [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that
  can cancel the assertion. Aborting the signal fails the assertion like a timeout: if the signal
  is aborted while the assertion is retrying, or is already aborted before the assertion starts,
  the assertion fails without retrying further.

  In Elixir, a `Playwright.AbortSignal` (`Playwright.AbortController.signal/1`).
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the assertion for in milliseconds, `0` for no timeout. Defaults to `:timeout` in `config :playwright, :expect` (`5000` if not set, see the configuration in `Playwright.Expect`).

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_match_aria_snapshot!`

```elixir
@spec to_match_aria_snapshot!(
  Playwright.Locator.t()
  | Playwright.Page.t()
  | t(Playwright.Locator.t() | Playwright.Page.t()),
  String.t() | nil,
  to_match_aria_snapshot_options()
) :: :ok
```

Like `to_match_aria_snapshot/3`, but raises `Playwright.ExpectError` when the expectation is not met.

# `to_pass`

```elixir
@spec to_pass((-&gt; term()) | t((-&gt; term())), to_pass_options()) ::
  :ok | {:ok, term()} | {:error, Playwright.error()}
```

You can retry blocks of code until they are passing successfully.

```elixir
Expect.to_pass!(fn ->
  response = page |> Page.request() |> APIRequestContext.get!("https://api.example.com")
  assert APIResponse.status(response) == 200
end)
```

You can also specify custom timeout and retry intervals:

```elixir
Expect.to_pass!(
  fn ->
    response = page |> Page.request() |> APIRequestContext.get!("https://api.example.com")
    assert APIResponse.status(response) == 200
  end,
  # Probe, wait 1s, probe, wait 2s, probe, wait 10s, probe, wait 10s, probe
  # ... Defaults to [100, 250, 500, 1000].
  intervals: [1_000, 2_000, 10_000],
  timeout: 60_000
)
```

Note that by default `toPass` has timeout 0 and does not respect custom expect timeout.

In Elixir, the callback runs in the calling process and passes once it returns. A failure in it (a raise such as an `ExUnit.AssertionError` or a `Playwright.ExpectError`, an exit) is retried; the last one is in the timeout's message. A callback still running at the deadline is not interrupted. A soft receiver (`callback |> Expect.soft() |> Expect.to_pass()`) works as for any matcher.

In Elixir, `to_pass!/2` returns the callback's value of the attempt that passed (`to_pass/2`: `{:ok, value}`), which a JS callback assigns to an outer `let` (an Elixir closure can't):

```elixir
box =
  Expect.to_pass!(fn ->
    box = Locator.bounding_box!(locator)
    assert box.width == 30
    box
  end)
```

A soft one that fails returns `nil` (`{:ok, nil}`), a negated one (`Expect.not_/1`) `:ok`, as `not_to_pass/2`.

*Since Playwright 1.29.*

## Options

* `:intervals` (list of `t:integer/0`) - Probe, wait 1s, probe, wait 2s, probe, wait 10s, probe, wait 10s, probe: `[1_000, 2_000, 10_000]`. Defaults to `[100, 250, 500, 1000]`.
* `:timeout` (`t:number/0` | `:infinity`) - Time to retry the callback for in milliseconds. Defaults to `0`: until the test's timeout (none outside a `Playwright.Test` test), not the matchers' `:timeout`. A default other than `0` is `:to_pass` in `config :playwright, :expect` (see the configuration in `Playwright.Expect`). Within a test, it ends before the test's timeout.

  In Elixir, `:infinity` is the same as `0`: no timeout.

# `to_pass!`

```elixir
@spec to_pass!((-&gt; term()) | t((-&gt; term())), to_pass_options()) :: term()
```

Like `to_pass/2`, but raises `Playwright.ExpectError` when the expectation is not met.

---

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