🖥

reg-suit の VRT (ビジュアルリグレッションテスト) を local だけで実行・レポート閲覧ができる reg-cli ライブラ

2024/02/19に公開

reg-cliとは

https://github.com/reg-viz/reg-cli

かなりマイナーなライブラリのようだが、localだけでVRTを実行してHTMLレポートで比較できるようだ

npm i -g reg-cli
 reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir -R ./report.html

以下のように使う

reg-cli <画像のあるディレクトリ(1)> <画像のあるディレクトリ(2)> <差分を生成するディレクトリ> -R <レポート用のHTMLを生成するファイルパス>

画像群はどうやって用意する?

何らかの方法で用意する。
方法は問わない。

「比較したいgitブランチを切り替えて、それぞれスクリーンショットを生成するスクリプト走らせる」とか。

reg-suit とは

reg-suit

画像を比較してHTMLのレポートにしてくれるプラグイン

Compare Images - reg-suit is inspired by snapshot testing. It compares the current images with the previous images, creates an HTML report for their differences. All you need is to give images to assert.

画像はCloudに自動保存される

Store Snapshots - reg-suit automatically stores snapshot images to external cloud storage(e.g. AWS S3, Google Cloud Storage). You can review result of comparison and differences at any time you want.

localでも各種CIでも動かすことが出来る
(だが画像保存先がクラウドなので、完全にlocalだけで実行できるわけではなさそうだ)

Work Everywhere - reg-suit is just a CLI. So it's easy to integrate with your project. It works at any CI services and even your local machine.

クラウド保存先

AWS S3 と GCP の GCS が選べるようだ (2024/02/13現在)

参考

https://note.com/cyberz_cto/n/n79e344f59651

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

プロフィール・経歴

https://github.com/YumaInaura/YumaInaura

公開日時

2024-02-13

GitHubで編集を提案

Discussion