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
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
61k
アプリ名を変更するプラグインを作った話
moyashidaisuke
0
160
20180315これで簡単Laravelの認証処理をカスタマイズ
moyashidaisuke
0
1k
PHP製マーケティングオートメーション(MA)ツール Mauticの紹介
moyashidaisuke
0
870
20170621LaravelでDeployer
moyashidaisuke
0
540
Other Decks in Technology
See All in Technology
KAEN Company Deck
kaen
PRO
0
320
生成AI時代の クレデンシャルとパーミッション設計
nrinetcom
PRO
3
1.5k
AIとペアプロを始める。人とのペアプロをやめる。ペアプロの良さを改めて知る。もっと好きになった。 / Rediscovering Pair Programming
honyanya
1
240
Bet AI Day 2026丨AIによって本質に戻るシステムリスク管理
layerx
PRO
0
880
DINO-EdgeQuery:Edge-First Polygon Decoding for Building Footprint Extraction from Satellite Imagery
lehupa
0
140
AIで実装は速くなった。なのにプロダクトは速くならない。職能の壁を越えて価値のフローを設計する
nwiizo
6
7.1k
AI時代に、プロダクトの数だけ積み上がる所有コストをどうエンジニアリングするか / Engineering the Cost of Ownership
kzkmaeda
0
1k
[RSJ26] Building a VLA Model Based on Self-Distilled Classification
keio_smilab
PRO
0
190
いま、生成AIにKaggleをどこまで 任せられるか — ROGIIコンペでの進め方とTips
k951286
3
1.4k
はじめてのDatabricks:技術者向けワークショップ / beginner-workshop
databricksjapan
PRO
0
150
module Synths; end
asonas
1
100
Nav2、Nav3 ... はたまた自作?〜 作って理解する Nav3 の設計意図 〜 / Nav2, Nav3 ... or Build Your Own? — Understanding Nav3's design intent by building it from scratch
yanzm
0
230
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
Six Lessons from altMBA
skipperchong
29
4.5k
How to make the Groovebox
asonas
2
2.4k
The browser strikes back
jonoalderson
0
1.6k
The SEO identity crisis: Don't let AI make you average
varn
0
550
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
810
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
310
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
300
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