0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

BackstopJSとは

Posted at

こんにちは
未来電子という会社でインターンをさせてもらっているものです。
まだ経験が浅いため、間違いがあるかもしれませんが、お手柔らかにお願いします。

今回はBackstopJSについて備忘録として書きます。

BackstopJSとは

BackstopJSとは変更前後のスクリーンショットの差分を抽出してテストするvisual regression testです。
(visual regression testとは視覚的に回帰してテストするということです。)

普通UIの表示崩れなどが起こったときなどはtemplatesを見ることによって解決していました。
しかしBackstopJSはスクリーンショットで差分を検出できるため、templatesを見なくても良くなるのです。
そのためUIをチェックするときに非常に便利です。

インストール方法、使い方

$ npm install -g backstopjsでインストールできます。

$ backstop init
で初期化します。

次に
$ yarn storybook
でタブを増やし
$ yarn spec:visual
でスクリーンショットを取ります。

最後に
$ yarn test:visual
で再度スクリーンショットを取り、差分をテストすることができます。

異なる部分があればエラーが表示されます。

参照サイト

https://github.com/garris/BackstopJS
https://qiita.com/Yuta_Yamamoto/items/44c6f51fdbc103302f43
http://lab.astamuse.co.jp/entry/2017/08/30/114500

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?