auto_golden_storybook 0.1.4 copy "auto_golden_storybook: ^0.1.4" to clipboard
auto_golden_storybook: ^0.1.4 copied to clipboard

Auto generates a storybook from your golden test images. This is generated as a web project in a subdirectory in your project and can be immediately deployed.

Auto Generate Storybook #

Pub.dev: auto_golden_storybook

Description #

A command-line tool to auto generate a storybook of your golden images. It automatically sets up a storybook subdirectory within your project, and populates it with 'story' objects for each golden image it finds in the test directory.

Currently it will only use png images, and it will only accept one top level directory for the 'test' directory.

Usage #

dart run auto_golden_storybook:create

Configuration #

You can put configuration in your pubspec.yaml or use them on the command line. For example:

auto_golden_storybook:
  name: "project_storybook"
  test_dir: "test/goldens"

Or:

dart run auto_golden_storybook:create --name=project_storybook --test_dir="test/goldens"

By default the created web project will be called: "storybook". It will assume your test directory is called "test" and will generate stories for all png images found in all subdirectories of the test directory.

There are a couple of generated files you can change for your own purposes, device_frame.dart and golden_image_container.dart. The device frame is part of the Storybook package and you can change that to use which ever frame you choose as a default.

golden_image_container.dart is a widget that wraps the golden image in a container and scales away the border created by golden images. It also wraps it in a ListView so it can scroll. You can change how much scale it adds to deal with your own golden images.

Roadmap #

Automatically choose frame based on golden image size. More Configuration Options More Tests

Contributing #

Please suggest features or bugs on the issue tracker in Github.

License #

MIT License - see the LICENSE.md file for details

1
likes
150
points
54
downloads

Publisher

unverified uploader

Weekly Downloads

Auto generates a storybook from your golden test images. This is generated as a web project in a subdirectory in your project and can be immediately deployed.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, args, cli_util, code_builder, dart_style, flutter, logging, path, recase, source_gen, storybook_flutter, yaml

More

Packages that depend on auto_golden_storybook