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
Selenium + Sinon.js
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kazuhito Hokamura
January 27, 2015
Programming
820
0
Share
Selenium + Sinon.js
http://qiita.com/hokaccha/items/9f4dc019c2ea8c6c58a3
Kazuhito Hokamura
January 27, 2015
More Decks by Kazuhito Hokamura
See All by Kazuhito Hokamura
TypeScriptとGraphQLで実現する 型安全なAPI実装 / TSKaigi 2024
hokaccha
5
5.1k
Kotlin製のGraphQLサーバーをNode.jsでモジュラモノリス化している話
hokaccha
0
3.8k
GraphQLの負債と向き合うためにやっていること
hokaccha
2
1.6k
ユビーのアーキテクチャに対する取り組み
hokaccha
1
480
RailsエンジニアのためのNext.js入門
hokaccha
7
22k
Cookpad Summer Internship 2021 Web Frontend
hokaccha
0
7.4k
巨大なモノリシック Rails アプリケーションの マイクロサービス化戦略 / 2019 microservices in cookpad
hokaccha
3
4.1k
巨大なRailsアプリケーションを「普通」にするための取り組み
hokaccha
1
1.1k
Web Frontend Improvement in Cookpad
hokaccha
1
1.2k
Other Decks in Programming
See All in Programming
JCON - Create Agentic AI Apps, The Easy Way!
kdubois
1
110
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
160
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
150
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
150
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
170
From Formal Specification to Property Based Test
ohbarye
0
2.6k
GoogleCloudとterraform完全に理解した
terisuke
1
200
PHPer、Cloudflare に引っ越す
suguruooki
2
200
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
440
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
190
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
The SEO identity crisis: Don't let AI make you average
varn
0
460
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Into the Great Unknown - MozCon
thekraken
41
2.5k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
Marketing to machines
jonoalderson
1
5.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
180
It's Worth the Effort
3n
188
29k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
170
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Խ
ͨͩ͠Γ͗͢Δͱ ࢮ͵ͷͰҙ