Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Selenium + Sinon.js
Search
Kazuhito Hokamura
January 27, 2015
Programming
0
800
Selenium + Sinon.js
http://qiita.com/hokaccha/items/9f4dc019c2ea8c6c58a3
Kazuhito Hokamura
January 27, 2015
Tweet
Share
More Decks by Kazuhito Hokamura
See All by Kazuhito Hokamura
TypeScriptとGraphQLで実現する 型安全なAPI実装 / TSKaigi 2024
hokaccha
5
4.8k
Kotlin製のGraphQLサーバーをNode.jsでモジュラモノリス化している話
hokaccha
0
3.7k
GraphQLの負債と向き合うためにやっていること
hokaccha
2
1.5k
ユビーのアーキテクチャに対する取り組み
hokaccha
1
450
RailsエンジニアのためのNext.js入門
hokaccha
7
21k
Cookpad Summer Internship 2021 Web Frontend
hokaccha
0
7.3k
巨大なモノリシック Rails アプリケーションの マイクロサービス化戦略 / 2019 microservices in cookpad
hokaccha
3
4k
巨大なRailsアプリケーションを「普通」にするための取り組み
hokaccha
1
1k
Web Frontend Improvement in Cookpad
hokaccha
1
1.1k
Other Decks in Programming
See All in Programming
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
150
AIコーディングエージェント(NotebookLM)
kondai24
0
130
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
160
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
260
FluorTracer / RayTracingCamp11
kugimasa
0
190
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
590
How Software Deployment tools have changed in the past 20 years
geshan
0
28k
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
190
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
190
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
310
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
140
開発に寄りそう自動テストの実現
goyoki
1
430
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.1k
Done Done
chrislema
186
16k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Documentation Writing (for coders)
carmenintech
76
5.2k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
960
How to train your dragon (web standard)
notwaldorf
97
6.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Building Applications with DynamoDB
mza
96
6.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Facilitating Awesome Meetings
lara
57
6.7k
The Language of Interfaces
destraynor
162
25k
Transcript
Selenium + Sinon.js #template_literal_sushi #e2e_sushi
$('button').click(function() { navigator.geolocation.getCurrentPosition( function(res) { var lat = res.coords.latitude; var
lon = res.coords.longitude; $('#pos').text(lat + ':' + lon); }); });
// stub.js sinon.stub(navigator.geolocation, 'getCurrentPosition') .callsArgWith(0, { coords: { latitude: 10,
longitude: 20 } });
// sinon.jsͱstubͷεΫϦϓτΛ࣮ߦ driver.executeScript(fs.readFileSync('./sinon.js').toString()); driver.executeScript(fs.readFileSync('./stub.js').toString()); // ςετ࣮ߦ driver.findElement(By.css('button')).click(); driver.findElement(By.css('#pos')).getText().then(function(text) { assert(text
=== '10:20'); });
ଞʹ͜͏͍͏έʔεͰ͑Δ͔ • खͰ࠶ݱͮ͠Β͍ҟৗܥͷ࠶ݱ • APIϨεϙϯεͷmockԽ
ͨͩ͠Γ͗͢Δͱ ࢮ͵ͷͰҙ