Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
20180125mocha.jsとbackstop.jsで大規模リニューアルのリグレッショ...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
moyashidaisuke
January 27, 2018
Technology
770
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20180125mocha.jsとbackstop.jsで大規模リニューアルのリグレッションテスト
moyashidaisuke
January 27, 2018
More Decks by moyashidaisuke
See All by moyashidaisuke
個人開発がやりたくなる本を読んでモチベーションアップを図る話
moyashidaisuke
0
62k
アプリ名を変更するプラグインを作った話
moyashidaisuke
0
160
20180315これで簡単Laravelの認証処理をカスタマイズ
moyashidaisuke
0
1k
PHP製マーケティングオートメーション(MA)ツール Mauticの紹介
moyashidaisuke
0
880
20170621LaravelでDeployer
moyashidaisuke
0
540
Other Decks in Technology
See All in Technology
「作れる」と「リリースできる」の間にあったもの── PdMを外して見えた、PdMがやるべき仕事/Buildable ≠ Shippable: What Removing the PM Taught Me About the PM’s Job
yappli_developers
0
320
reInvent2026stby LT00 "Change your life!"
shinichirokawano
1
360
Let's Change Our World—Again
snoozer05
PRO
6
700
DevelopersIO 2026 Tokyo 現時点の衛星通信サービスの現状を整理してみる
maroon1st
0
320
Agent × Maestro で始める モバイル E2E 端末準備からテスト実行・結果確認まで
sansantech
PRO
0
220
AWS DevOps Agentはどこまで任せられるか 〜機能の現在地と、機能拡張の実践〜
nyankotaro
0
260
LLMの知識とAIエージェント
happysamurai294
0
110
クラウドサインを止めずに Nuxt へ 次の10年のために先に決めたこと
bengo4com
1
170
AIエージェント時代、Kaggleにどう取り組むか
takanao
1
300
演劇と私とスクラム
chinmo
0
160
PostgreSQL at Microsoft: Open Source, AI, & Cloud | Claire Giordano | PGConf.EU 2026
clairegiordano
0
110
Snowflake でできることが増えたら、 ABAC が必要になった
kaeton
0
110
Featured
See All Featured
Building Adaptive Systems
keathley
44
3.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Bash Introduction
62gerente
615
220k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
810
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
800
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
640
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
510
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
550
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Transcript
mocha.jsͱbackstop.jsͰେن ϦχϡʔΞϧͷϦάϨογϣ ϯςετ 2018/01/25 meguro.es #13 @ ϥΫεϧ༷
ࣗݾհ • ͡Ί·ͯ͠ • ాେཌྷʢ;͍͚ͩͩ͘͢ʣ • @moyashidaisuke • ίϩϓϥ ->
ΈΜΕͼ • αʔόαΠυΑΓͰ͕͢ϑϩϯτΓ· ͢ɻੲjsͱcssͰΨνϟԋग़࡞ͬͨΓͯ͠ ·ͨ͠ɻ • ࠇࡏॅ
5NB8FP(A4M ,- .& !B .QXSYWUV#/2E"C82+ D? 6<=2E9/ :B>'$B1LHE;.2EB0B"AL<;*@RSTD? 7GKN=2E9/
')B8FIP A4KNMJ3A/ O6LI92%?82'$B LPBA8E9/
େنϦχϡʔΞϧ͠·ͨ͠ ʢ༷ಉ͡··ʣ
ର • ͓͞Μศʢhttps://obousan.minrevi.jp/ʣ • Ϩεϙϯγϒ • IDҧؚ͍Ίͯϖʔδ600͘Β͍ • ΄ͱΜͲ͕੩తϖʔδ
چڥ • WordpressͷݻఆϖʔδΦϯϦʔ • Ϩϯλϧαʔό1ߏ
৽ڥ • Laravel + WordpressʢRestAPIʣ • AWSʢEC2ɺCloudFrontɺS3ɺALBɺRDSʣ • ͍ͭͰʹϑϧHTTPSԽ
എܠ • HP͡Όͳͯ͘WEBαʔϏεͱͯ͠ػೳՃ͠ ͍͖͍ͯͨ • Խͯ͠ͳ͍ͷͰ·ΕʹΑ͘མͪΔ • εύήςΟ • ࣌ͷ୲ऀෆࡏͰਖ਼͍༷͠ෆ໌
ϦάϨογϣϯςετ
Γ͍ͨࣄ • ͱΓ͋͑ͣݟͨಉ͡ΛΩʔϓ͍ͨ͠ • SEOؤுͬͯΔͷͰmetaλάͱ͔Ωʔϓ͠ ͍ͨ
ݟͨΩʔϓ
Backstop.js • https://github.com/garris/BackstopJS • ϒϥβදࣔͨ݁͠ՌΛը૾Ͱอଘ • ը૾ಉ࢜Λൺֱͯ͠diffΛग़ͯ͘͠ΕΔ • ը໘αΠζࢦఆͰ͖ΔͷͰɺPCͱεϚϗ྆ํ νΣοΫՄೳ
݁Ռ
݁Ռ
࢝Ίํ npm i phantomjs casperjs -g npm i backstopjs -g
backstop reference backstop test
ઃఆϑΝΠϧ { "viewports": [ { "label": "phone", "width": 320, "height":
480 }, { "label": "tablet", "width": 1024, "height": 768 } ], "scenarios": [ {"label": "/","url": “https://testdomain/" ,"referenceUrl": "http://obousan.minrevi.jp/"}, {"label": "/aisatsu-reibun/","url": “https://testdomain/aisatsu-reibun/", "referenceUrl": "http://obousan.minrevi.jp/aisatsu-reibun/"}, ], Ωϟϓνϟ͍ͨ͠ ը໘αΠζ ରͷ63-Λྻڍ
metaλάͱ͔Ωʔϓ
mochaͱcheerio-httpcliͰࣗ࡞ • mocha -> testingͷFW • cheerio-httpcli -> εΫϨΠϐϯά •
ؤுͬͯεΫϨΠϐϯάͯ͠metaλάΛऔಘ͠ ͯɺassert͢Δ • େͨ͠ࣄ͍ͯ͠ͳ͍ͷͰ͋Γͦ͏Ͱແ͔ͬͨʢ͋ͬ ͨΒڭ͍͑ͯͩ͘͞ʂʣ
εΫϦϓτͪΒݟͤ function getSeoData(url) { const data = {}; const result
= client.fetchSync(url); data.title = result.$('title').text(); data.keywords = result.$('meta[name="keywords"]').attr('content'); return data; } describe(senario.url, () => { let newSeoData, oldSeoData; before(done => { newSeoData = getSeoData(newUrl); oldSeoData = getSeoData(oldUrl); done(); }); // ҎԼςετέʔε it('title', () => { assert.equal(newSeoData.title, oldSeoData.title); }); it('keywords', () => { assert.equal(newSeoData.keywords, oldSeoData.keywords); }); }); });
݁Ռ
ۤ࿑ͱ͔ͱ͔
ۤ࿑ͱ͔ͱ͔ • backstopͷ݁Ռϖʔδ͕ॏ͍ͨͷʢը૾͕େྔʣͰదͷ·ͱ Ίͳ͍ͱ։͚ͳ͍ • ग़ྗ݁ՌΛάϧʔϐϯάͰ͖ͳ͍ͷͰɺઃఆϑΝΠϧ͝ͱ͚ Δඞཁ͕͋Δ • ͦΕͰॏ͔ͨͬͨͷͰʢ100ը໘Ͱ1GB͘Β͍ɺɺɺʣɺS3 ʹhostingͨ͠
• backstop ϖʔδϦϯΫ͕ແ͍ͷͰؤுͬͯεΫϩʔϧɺɺɺ • ݁ߏ͔͔࣌ؒΔͷͰɺશϖʔδΛରʹ͢Δͷதʹ࣮ߦ
QA