Skip to Content
steep

Export cookbook

Common exports, in Go, in a steep test, and with the CLI.

Each recipe is the same export three ways. The formats and effects behave the same in all of them.

The failure a CI job uploads

Keys, the last screen, and a card with the failures. This is a good default for a test suite. Running in CI has the rest of the job.

steep.WithRecording(reel.Profile{
	Outputs: reel.MustFiles("{name}_{status}.webp", "{name}_{status}.cast"),
	Render:  []render.Option{render.WithWindowChrome(true)},
	Effects: []reel.Effect{effects.Keys(time.Second), effects.Pause(), steep.Outro(2 * time.Second)},
}),
steep.WithExportOnFailure(),
A failing test recorded with keys, a pause, and a FAIL card
Open in the inspector ↗

A demo for a README

Small, sharp, and looping.

reel.Export(ctx, tl, reel.Profile{
	Outputs: reel.MustFiles("demo.webp"),
	Render: []render.Option{
		render.WithWindowChrome(true),
		render.WithPadding(10),
		render.WithBorderRadius(10),
	},
	Effects: []reel.Effect{effects.Keys(time.Second), effects.Pause()},
})
A framed recording of the shop
Open in the inspector ↗

A GIF that stays small

max-bytes drops the oldest frames to stay under a limit, so the end of the recording survives. That suits CI, where the end is where the failure is.

Outputs: reel.MustFiles("demo.gif?max-bytes=5MB"),

A video for social media

MP4 plays nearly everywhere. Scale it up, since sites will resize it. Add a card, so that it has a beginning.

reel.Profile{
	Outputs: reel.MustFiles("demo.mp4?quality=90"),
	Render:  []render.Option{render.WithWindowChrome(true), render.WithScale(2)},
	Effects: []reel.Effect{
		effects.Intro(2*time.Second, effects.Line{Text: "My tool"}),
		effects.Keys(time.Second),
		effects.Pause(),
	},
}

A screenshot at each step

Outputs: reel.MustFiles("shot-{mark}.png?match=step:*"),
A still of the shop during a brew

A recording that hides a secret

Redact first, and leave out .cast, which would keep the secret.

reel.Profile{
	Outputs: reel.MustFiles("demo.webp"),
	Effects: []reel.Effect{
		effects.Redact(effects.Env("API_TOKEN")),
		effects.RedactInputs(effects.Env("API_TOKEN")),
		effects.Keys(time.Second),
	},
}
The shop with its license key blurred

The last bit of a long recording

window, err := tl.Between("deploy:start", "")
// ...
err = reel.Export(ctx, window, reel.Profile{Outputs: reel.MustFiles("deploy.gif")})

Last updated on

On this page