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
moyashidaisuke
January 27, 2018
Technology
760
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
【Findyテック文化祭ワークショップ】新卒エンジニア&採用担当と作る、 なりたい姿と今やるべき一歩
dip_tech
PRO
0
150
HolmesGPTで始めるSREエージェント入門!プラットフォームの障害調査はAIにお任せ 〜
leveragestech
PRO
0
120
顧客の成果創出とプロダクトの成長を 両立するためのFDE
sansantech
PRO
0
520
The seven pitfalls of AI (revised version)
ufried
0
130
AI Native Platform Engineering 〜PlatformとAgileで“作る速さ”を“価値”へ〜
uya116
0
510
The kernel report
ennael
PRO
1
150
Swap and Memory Reclaim - Squeezing Out More RAM
ennael
PRO
1
1.4k
[Kiro Meetup #7] Kiro Crew Dive Deep
konippi
0
430
OpenClawでAzure DevOpsのWiki更新を自動化する - クラウドAIだけでは届かない場所へ
yutakaosada
0
130
Mastering Agentic Development: Harness Engineering for Effective Coding Agents
konippi
3
660
個別開発で終わらせない。 現場の課題をプロダクトの強さに変える StockmarkのFDE
ktkrhr
0
440
20260915deck.gl-raster を使ってみた
rena1208
0
170
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
380
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Side Projects
sachag
456
43k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
Claude Code のすすめ
schroneko
67
230k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
390
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
600
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