Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Chromaticで手軽にVisual Regression Testを導入する / Visu...
Search
Shingo Yamazaki
June 28, 2019
Technology
2
1.5k
Chromaticで手軽にVisual Regression Testを導入する / Visual Regression Testing with Chromatic
We Are JavaScripters! @33rd【初心者歓迎・LT会】の登壇資料です
デモ動画:
https://youtu.be/9qsX_UsyG-g
Shingo Yamazaki
June 28, 2019
Tweet
Share
More Decks by Shingo Yamazaki
See All by Shingo Yamazaki
顧客価値に向き合うためのCREのススメ
zakiyama
4
1.1k
ログラスCREのこれまでとこれから(2023年)
zakiyama
0
370
カスタマーサポートを立ち上げてからやったこと
zakiyama
0
310
組織一丸となってカスタマーサクセスを実現するための取り組みと悩み
zakiyama
0
2k
プロダクトと顧客をつなぐログラスのCREの取り組み
zakiyama
2
4.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Chromium版EdgeのTracking Prevention機能 / Tracking Prevention in Chromium-based Microsoft Edge
zakiyama
0
1.6k
LWCのローカル開発機能(ベータ)を試す / LWC Local Development
zakiyama
0
500
kintone開発チームのモブプロ事情 / Mob programming in kintone dev team
zakiyama
0
4.5k
Other Decks in Technology
See All in Technology
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
680
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
AGIについてChatGPTに聞いてみた
blueb
0
130
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
Platform Engineering for Software Developers and Architects
syntasso
1
510
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
Terraform Stacks入門 #HashiTalks
msato
0
350
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
380
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Documentation Writing (for coders)
carmenintech
65
4.4k
The World Runs on Bad Software
bkeepers
PRO
65
11k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
It's Worth the Effort
3n
183
27k
Designing for Performance
lara
604
68k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Transcript
ChromaticͰ खܰʹ Visual Regression TestΛ ಋೖ͢Δ 2019/06/28 We Are JavaScripters!
@33rd
࠷ۙௐ͍ͯͨ πʔϧͷΛ͠·͢
• Shingo Yamazaki • αΠϘζגࣜձࣾ (2018/12~) • kintone ։ൃνʔϜɹ݉ ϑϩϯτΤϯυΤΩεύʔτνʔϜ
• #WeJS ॳࢀՃͰ͢ About me zaki-yama zaki___yama
• ͱ͋ΔUIίϯϙʔωϯτϥΠϒϥϦ։ൃͷ ͓ख͍Λ͍ͯ͠Δ • JS -> TypeScript Ҡߦ͕ϝΠϯ • ʮUI
ίϯϙʔωϯτ͕σάϨͯ͠ͳ͍͜ͱΛ୲อ͢Δ ͘͠Έʗπʔϧ͕΄͍͠Ͷʯͱ͍͏͕͋ͬͨ • ݱࡏ Storybook + Storyshots Λར༻த Intro
• UIίϯϙʔωϯτͷ։ൃ & ϒϥδϯάڥΛఏڙ ͢ΔOSS • ίϯϙʔωϯτΛΞϓϦ έʔγϣϯͱಠཱͨ͠ڥ Ͱ։ൃͰ͖Δ •
ಈ࡞͢Δίϯϙʔωϯτ͕ ҰཡͰݟΒΕΔ Storybook?
• StorybookͷΞυΦϯ • JestͷSnapshot TestingΛར༻ • ίϯϙʔωϯτͷSnapshotΛऔ ಘ͠ɺอଘͯ͋͠Δͷͱൺֱ • DOMͷൺֱͳͷͰɺελΠϧͷ
่Εͱ͔ݕͰ͖ͣ Storyshots? IUUQTTUPSZCPPLKTPSHEPDTUFTUJOHTUSVDUVSBMUFTUJOH
https://twitter.com/domyen/status/1138861429669412864?s=20
https://twitter.com/domyen/status/1138861429669412864?s=20 %FTJHOTZTUFN͓͖ͯ͞ ͜ͷπʔϧؾʹͳΔ
Chromatic
Chromatic
• Visual Testing Λͬͯ͘ΕΔαʔϏε • “Made for Storybook by Storybook
maintainers” • OSSແྉ Chromatic
DEMO
͍ํ
• Storybook ಋೖࡁΈͷGitHubϦϙδτϦΛ༻ҙ • https://www.chromaticqa.com/ ʹΞΫηε • GitHubΞΧϯτͰSign in •
Add project ͰϦϙδτϦΛબ ΞΧϯτొ #JUCVDLFU (JU-BC ʹରԠ
ϦϙδτϦଆͰඞཁͳͷ3 Step $ISPNBUJDΛ Πϯετʔϧ TUPSZCPPLDPOpHKTʹ ߦՃ εΫϦϓτ࣮ߦ project͝ͱʹϢχʔΫͳapp code
͜ͷ63-ʹΞΫηε
• ͋ͱchromatic testͷͨͼʹbuild & diffൺֱ ॳճͷbuildޭ
package.json CIͷઃఆ(CircleCIͷ߹) .circleci/config.yml
• \ • CIͷઃఆ(CircleCIͷ߹) BQQDPEFͰ͍ͯͨ͠
Ͱ͖ͨ
EJ⒎Λ֬ೝ͠ɺ"DDFQU%FOZ શ෦νΣοΫ͢Δͱ(JU)VCଆͷεςʔλ εߋ৽͞ΕΔ %0.ʹมߋ͋Ε͜͜ʹදࣔ͞ΕΔ
ศརͳػೳ
ίϯϙʔωϯτΛදࣔ͠ͳ͕ΒɺҟͳΔϒϥϯ νաڈͷϏϧυ݁ՌʹΓସ͑ΒΕΔ Library
※Standard/Pro ϓϥϯͷΈ Multi Browser Support
ࢦఆͨ͠ViewportͰෳͷSnapshotΛࡱͬͯ͘ ΕΔ Viewports
Tips
• ͕ࠩ͋ͬͯϏϧυࣗମPassʹ͢Δ • ͚ͭͳ͍ͱʮશ෦Accept͚ͨ͠ͲCircleCIͷ εςʔλεFailedͰϚʔδͰ͖ͳ͍ʯͱͳΔ CI༻ͷεΫϦϓτʹ --exit-zero-on-changesΛ͚ͭΔ
Open source plan৹͕ࠪඞཁ 4JHOJOͨ͠Βී௨ʹ͑ͨͷͰ 1VCMJD3FQPTJUPSZͳΒͳΜͰ0,ͳͷ͔ͱࢥͬͯ·ͨ͠
• ҰԠChatͰฉ͍͚ͨͲ ͬͺΓͦ͏ͬΆ͍ Open source plan৹͕ࠪඞཁ
• ໌ه͞Εͯͳ͍͕ ͜ΕChatͰฉ͍ͯΈͨ • গͳ͘ͱBrowser ChromeͷΈͱͷ͜ͱ Open source plan starter
planѻ͍ʁ
ຊޠϑΥϯτ͕… ͜Ε͕ ͜͏ͳͬͨ
• .storybook/preview-head.htmlͰ web fontಡΈࠐ·ͤͯΈ͚ͨͲͩΊͰͨ͠ ຊޠϑΥϯτ͕…
• ։ൃνʔϜʹ ϑΟʔυόοΫ͢Δɺ ͱݴͬͯͨ ຊޠϑΥϯτ͕…
• StorybookΛར༻͍ͯ͠ΔϓϩδΣΫτʹ ͔ͳΓ͓खܰʹಋೖͰ͖Δ • diffएׯݟͮΒ͍ʢओ؍ʣ͚Ͳػೳे • ଞπʔϧͱൺֱͨ͠Θ͚Ͱͳ͍Ͱ͕͢ • OSSͳΒແྉʢͨͩ͠৹ࠪ͋Γʣ ·ͱΊ