Skip to content
/ RSA Public

RailsStorybookAppraise: A Rails app into your Storybook with Appraise.qa for visual approval testing

License

Notifications You must be signed in to change notification settings

nando/RSA

Repository files navigation

RailsStorybookAppraise

Proof of Concept of a Rails app into Storybook with Appraise.qa for visual approval testing (kind of Chromatic.com DIY ;).

The Talk (at MadridRB!! ✨)

January 2022 - Component visual testing with ViewComponents and Appraise.qa

The Slides 📒

At Google Presentations

The Post (TL;DR)

Component visual testing with ViewCompontents and Appraise.qa

Dependencies (+ versions used)

Name Version
Rails 7.0.0
Storybook 6.4.9
Appraise 0.6.0
Ruby 3.0.0p0
Node 17.3.0
Yarn 1.22.17

Install

$ git clone https://github.com/nando/RSA.git
$ cd RSA
$ bundle install
$ yarn install

Run

$ rake view_component_storybook:write_stories_json
$ bundle exec rails server

At this point we have two options:

  • run our Storybook server localy: npm run storybook, or
  • generate it static at public/storybook/: npm run storybook:build

If we have opted for the latter option (usual when deploying to a server) we should be able to enjoy the stories of our components in http://localhost:3000/storybook/.

Test!!

$ npm run examples

To approve all the examples in one page:

$ npm run approve -- --page "awesome_component"

To approve a specific example:

$ npm run approve -- --page "awesome_component" --example "Button w short text"

The Beginning

Joel Hawksley's talk at RailsConf 2021 "ViewComponents in the Real World"

The Credits (Thanks!!)

About

RailsStorybookAppraise: A Rails app into your Storybook with Appraise.qa for visual approval testing

Topics

Resources

License

Stars

Watchers

Forks