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
Kazuhito Hokamura
January 27, 2015
Programming
830
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
490
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
act1-costs.pdf
sumedhbala
0
250
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
390
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
9.3k
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
170
5分で問診!Composer セキュリティ健康診断
codmoninc
0
590
Built Our Own Background Agent at LayerX #aidevex_findy
layerx
PRO
8
3.3k
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
550
What's New in Android 2026
veronikapj
0
190
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
160
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
540
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.3k
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
560
Leo the Paperboy
mayatellez
8
1.9k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
The SEO identity crisis: Don't let AI make you average
varn
0
520
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The Cost Of JavaScript in 2023
addyosmani
55
10k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
sira's awesome portfolio website redesign presentation
elsirapls
0
310
Practical Orchestrator
shlominoach
191
11k
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Խ
ͨͩ͠Γ͗͢Δͱ ࢮ͵ͷͰҙ