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
Espresso Driver を用いた Appium テストとその仕組み
Search
Kyohei Kato
February 18, 2019
Technology
0
6.4k
Espresso Driver を用いた Appium テストとその仕組み
Kyohei Kato
February 18, 2019
Tweet
Share
More Decks by Kyohei Kato
See All by Kyohei Kato
After Party DroidKaigi 2021
ksfee684
0
430
cookpad-summer-internship-2020-android
ksfee684
0
7.8k
cookpad.apk#5
ksfee684
0
470
cookpad.apk#4
ksfee684
0
580
Testing in weekly release
ksfee684
0
740
UI テストで楽するための技術
ksfee684
0
390
Android における UI テスト設計戦略
ksfee684
2
890
Other Decks in Technology
See All in Technology
Compose Compiler Metricsを使った実践的なコードレビュー
tomorrowkey
1
220
DMM.com アルファ室採用案内資料
hsugita
1
160
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
390
Azure Container Apps + Bicep 〜 こんな感じで運用しています
kaz29
2
480
長期間TiDBを使ってきた話 @ 私たちはなぜNewSQLを使うのかTiDB選定5社が語る選定理由と活用LT / Experiences with TiDB Over Time
chibiegg
2
910
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
570
VSCodeの拡張機能を作っている話
ebarakazuhiro
1
590
LLM開発・活用の舞台裏@2024.04.25
yushin_n
2
490
Delivering Millions of Messages within seconds @ Duolingo
pelelgrino
0
350
ChatworkのSRE部って実は 半分くらいPlatform Engineering部かもしれない
saramune
0
160
ChatGPT for IT Service Management (IT Pro)
dahatake
7
1.6k
現代CSSフレームワークの内部実装とその仕組み
poteboy
7
3.6k
Featured
See All Featured
Navigating Team Friction
lara
178
13k
How STYLIGHT went responsive
nonsquared
92
4.8k
4 Signs Your Business is Dying
shpigford
175
21k
Visualization
eitanlees
136
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Product Roadmaps are Hard
iamctodd
44
9.7k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Faster Mobile Websites
deanohume
299
30k
RailsConf 2023
tenderlove
4
540
Embracing the Ebb and Flow
colly
80
4.1k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
Gamification - CAS2011
davidbonilla
76
4.6k
Transcript
Espresso Driver を用いた Appium テストとその仕組み 1 Cookpad.apk #2
自己紹介 •加藤 恭平 (ksfee684) ‣ 技術部品質向上グループ ‣ レシピサービスの Android
アプリで UI テストなどを担当 ‣ おすすめは M:tG
アジェンダ •Appium in Android における仕組み ‣ UIAutomator 概要 ‣ UIAutomator
Driver •Espresso Driver 紹介 ‣ UIAutomator との比較 ‣ 実際どうなのか •おまけ ‣ Project Nitrogen !3 3
Appium
Appium •モバイル端末向け自動テスト ツール ‣HTTP Server (Node) ‣Android, iOS, Windows, macOS
UIAutomator •UI テスティングフレームワーク ‣ Accessibility Service を利用 ‣ アプリを越えて端末操作や情報取得が可能 ‣
e.g. UI Automator Viewer 6
None
UIAutomator × Appium •UIAutomator Driver として存在 •現在 Android のデフォルト Driver
!8 8
ςετରBQL 6*"VUPNBUPS4FSWFSBQL "OESPJE5FTUBQL UIAutomator Driver
UIAutomator Driver 6*"VUPNBUPS4FSWFS XEIVC TFTTJPOTFTTJPO@JE TUBUVT ESJWFSTBWF@TDSFFOTIPU 3VCZ 10 6J"VUPNBUJPOUBLF4DSFFOTIPU
"QQJVN4FSWFS XEIVC TFTTJPOTFTTJPO@JE TUBUVT
UIAutomator × Appium •Pros ‣ 自身のアプリに限らず操作を行う事が可能 • ブラックボックスな自動UIテストを組むことが可能 • テキストを利用した操作から
Resource ID まで •Cons ‣ テスト対象のアプリの操作が難しい • ネットワーク通信待ち合わせのためスリープ !11 11
Espresso Driver
UIAutomator Driver 6*"VUPNBUPS4FSWFS XEIVC TFTTJPOTFTTJPO@JE TUBUVT ESJWFSTBWF@TDSFFOTIPU 3VCZ 13 6J"VUPNBUJPOUBLF4DSFFOTIPU
"QQJVN4FSWFS XEIVC TFTTJPOTFTTJPO@JE TUBUVT
&TQSFTTP4FSWFS ESJWFSTBWF@TDSFFOTIPU 3VCZ XEIVC TFTTJPOTFTTJPO@JE TUBUVT Espresso Driver XEIVC TFTTJPOTFTTJPO@JE
TUBUVT
Espresso Driver •appium-espresso-driver ‣ Espresso を Driver として利用 ‣ 対象アプリの署名を書き換え
Espresso × Appium •Pros ‣ アプリの Context にアクセス可能に ‣ IdlingResource
によってスリープによる待ち合わせが不要 ‣ UIAutomator と同様にブラックボックスに記述できる! •Cons ‣ Espresso ができること以外はできない ‣ Debug ビルドのみ対応 16
実際どうなのか •実際に Driver を置き換えることでどうなるのか ‣ 不必要なスリープの減少 • シナリオ簡潔さ向上 ‣ 既存の
View 探索以外の手法 ‣ Driver の指定を変更するだけで便利 17
Appium Ruby Client •Capability の automationName を切り替えるだけ? •appium_lib では Espresso
Driver への切り替えが シュッとできない •appium_lib_core を直接利用
まとめ •appium-espresso-driver はいいぞ ‣ 互換性もだいたいあるぞ •UIAutomator から抜け出してシナリオ洗練させていくぞ 19
Project Nitrogen
Project Nitrogen •Write once, run everywhere
None
Espresso(Robolectric) Driver •Robolectric (JVM) 上で実行 •Capability によって切替可能に •対象アプリの実装が必要となるので、 既存アプリのテストケースとしてサーバを実装
Espresso(Robolectric) Driver •シュッとできなかった ‣ JUnit の別スレッドで Robolectric が動かない https://github.com/robolectric/robolectric/issues/ 3829