# Snapshots

A snapshot is the screenshot of one [scenario](/testing/overview) inside a [build](/cloud/builds/overview).
A review diffs snapshots, and Widgetbook Cloud [bills](/cloud/account/billing) snapshots.

One story produces one snapshot per scenario.
A scenario pins the [args](/args/overview) and the [modes](/addons/modes), so the same inputs produce the same image on every run.

The story below fixes the button text in two scenarios:

```dart title="widgetbook/lib/button.stories.dart"
final $Button = _Story(
  scenarios: [
    _Scenario(
      name: 'Short Text',
      args: _Args.fixed(text: 'Click Me'),
    ),
    _Scenario(
      name: 'Long Text',
      args: _Args.fixed(text: 'Click Me, I am a button with a very long text'),
    ),
  ],
);
```

The [global scenario definitions](/testing/create-scenario#define-global-scenario-definitions) below cross every scenario with a theme:

```dart title="widgetbook/lib/widgetbook.config.dart"
final config = Config(
  scenarioConfig: ScenarioConfig(
    definitions: [
      ScenarioDefinition(
        name: 'Light',
        modes: [MaterialThemeMode('Light', ThemeData.light())],
      ),
      ScenarioDefinition(
        name: 'Dark',
        modes: [MaterialThemeMode('Dark', ThemeData.dark())],
      ),
    ],
  ),
);
```

Two scenarios crossed with two definitions, four snapshots:

| <Image src="/assets/cloud/snapshots/button-dark-short-text.png" zoom caption="Short Text • Dark"  /> | <Image src="/assets/cloud/snapshots/button-light-short-text.png" zoom caption="Short Text • Light" /> |
| ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| <Image src="/assets/cloud/snapshots/button-dark-long-text.png" zoom caption="Long Text • Dark" />    | <Image src="/assets/cloud/snapshots/button-light-long-text.png" zoom caption="Long Text • Light" />   |

`flutter test` writes snapshots to `build/.widgetbook`, and `widgetbook cloud build push` uploads them.
See [Run Scenarios](/testing/run-scenarios) and [Upload builds](/cloud/builds/upload).

<Info>
Every uploaded build is billed for its snapshots, even when the images are identical to a previous build.
[Optimize Builds](/cloud/configure/optimize-builds) covers how to keep the count down.
</Info>
