# `Plushie.Test.Session`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/test/session.ex#L1)

A test session wrapping a running Plushie app.

Created by `Plushie.Test.Case` setup. All interaction functions
delegate to `Plushie.Test.Backend.Runtime`.

# `selector`

```elixir
@type selector() :: Plushie.Automation.Session.selector()
```

Test selector.

String selectors follow these rules:
- `"#save"` matches a unique local widget ID
- `"#form/save"` matches an exact scoped ID
- bare strings like `"Save"` match visible text

# `t`

```elixir
@type t() :: %Plushie.Test.Session{pid: pid()}
```

# `advance_frame`

```elixir
@spec advance_frame(session :: t(), timestamp :: non_neg_integer()) :: :ok
```

# `await_async`

```elixir
@spec await_async(session :: t(), tag :: atom(), timeout :: non_neg_integer()) :: :ok
```

# `canvas_move`

```elixir
@spec canvas_move(
  session :: t(),
  selector :: selector(),
  x :: number(),
  y :: number(),
  opts :: keyword()
) :: :ok
```

# `canvas_press`

```elixir
@spec canvas_press(
  session :: t(),
  selector :: selector(),
  x :: number(),
  y :: number(),
  button :: String.t(),
  opts :: keyword()
) :: :ok
```

# `canvas_release`

```elixir
@spec canvas_release(
  session :: t(),
  selector :: selector(),
  x :: number(),
  y :: number(),
  button :: String.t(),
  opts :: keyword()
) :: :ok
```

# `click`

```elixir
@spec click(session :: t(), selector :: selector(), opts :: keyword()) :: :ok
```

# `find`

```elixir
@spec find(session :: t(), selector :: selector(), opts :: keyword()) ::
  Plushie.Automation.Element.t() | nil
```

# `find!`

```elixir
@spec find!(session :: t(), selector :: selector(), opts :: keyword()) ::
  Plushie.Automation.Element.t()
```

# `model`

```elixir
@spec model(session :: t()) :: term()
```

# `move_to`

```elixir
@spec move_to(session :: t(), x :: number(), y :: number()) :: :ok
```

# `pane_focus_cycle`

```elixir
@spec pane_focus_cycle(session :: t(), selector :: selector(), opts :: keyword()) ::
  :ok
```

# `paste`

```elixir
@spec paste(
  session :: t(),
  selector :: selector(),
  text :: String.t(),
  opts :: keyword()
) :: :ok
```

# `press`

```elixir
@spec press(session :: t(), key :: String.t()) :: :ok
```

# `register_effect_stub`

```elixir
@spec register_effect_stub(
  session :: t(),
  kind :: Plushie.Effect.kind(),
  response :: term()
) :: :ok
```

# `release`

```elixir
@spec release(session :: t(), key :: String.t()) :: :ok
```

# `reset`

```elixir
@spec reset(session :: t()) :: :ok
```

# `runtime`

```elixir
@spec runtime(session :: t()) :: pid()
```

Returns the underlying Plushie.Runtime pid for direct interaction.

# `screenshot`

```elixir
@spec screenshot(session :: t(), name :: String.t(), opts :: keyword()) ::
  Plushie.Test.Screenshot.t()
```

# `scroll`

```elixir
@spec scroll(
  session :: t(),
  selector :: selector(),
  delta_x :: number(),
  delta_y :: number(),
  opts :: keyword()
) :: :ok
```

# `select`

```elixir
@spec select(
  session :: t(),
  selector :: selector(),
  value :: term(),
  opts :: keyword()
) :: :ok
```

# `slide`

```elixir
@spec slide(
  session :: t(),
  selector :: selector(),
  value :: number(),
  opts :: keyword()
) :: :ok
```

# `sort`

```elixir
@spec sort(
  session :: t(),
  selector :: selector(),
  column :: String.t(),
  direction :: String.t(),
  opts :: keyword()
) :: :ok
```

# `start`

```elixir
@spec start(app :: module(), opts :: keyword()) :: t()
```

Starts a new test session.

# `stop`

```elixir
@spec stop(session :: t()) :: :ok
```

# `submit`

```elixir
@spec submit(session :: t(), selector :: selector(), opts :: keyword()) :: :ok
```

# `toggle`

```elixir
@spec toggle(
  session :: t(),
  selector :: selector(),
  value :: boolean() | nil,
  opts :: keyword()
) :: :ok
```

# `tree`

```elixir
@spec tree(session :: t()) :: map()
```

# `tree_hash`

```elixir
@spec tree_hash(session :: t(), name :: String.t()) :: Plushie.Test.TreeHash.t()
```

# `type_key`

```elixir
@spec type_key(session :: t(), key :: String.t()) :: :ok
```

# `type_text`

```elixir
@spec type_text(
  session :: t(),
  selector :: selector(),
  text :: String.t(),
  opts :: keyword()
) :: :ok
```

# `unregister_effect_stub`

```elixir
@spec unregister_effect_stub(session :: t(), kind :: Plushie.Effect.kind()) :: :ok
```

---

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