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.7k
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
530
cookpad-summer-internship-2020-android
ksfee684
0
8k
cookpad.apk#5
ksfee684
0
570
cookpad.apk#4
ksfee684
0
670
Testing in weekly release
ksfee684
0
800
UI テストで楽するための技術
ksfee684
0
460
Android における UI テスト設計戦略
ksfee684
2
1k
Other Decks in Technology
See All in Technology
Datadog APM におけるトレース収集の流れ及び Retention Filters のはなし / datadog-apm-trace-retention-filters
k6s4i53rx
0
330
Datadogとともにオブザーバビリティを布教しよう
mego2221
0
130
TAMとre:Capセキュリティ編 〜拡張脅威検出デモを添えて〜
fujiihda
1
180
The Future of SEO: The Impact of AI on Search
badams
0
160
飲食店予約台帳を支えるインタラクティブ UI 設計と実装
siropaca
7
1.6k
N=1から解き明かすAWS ソリューションアーキテクトの魅力
kiiwami
0
110
リーダブルテストコード 〜メンテナンスしやすい テストコードを作成する方法を考える〜 #DevSumi #DevSumiB / Readable test code
nihonbuson
11
6.8k
インフラをつくるとはどういうことなのか、 あるいはPlatform Engineeringについて
nwiizo
5
2.4k
リアルタイム分析データベースで実現する SQLベースのオブザーバビリティ
mikimatsumoto
0
1.2k
10分で紹介するAmazon Bedrock利用時のセキュリティ対策 / 10-minutes introduction to security measures when using Amazon Bedrock
hideakiaoyagi
0
180
開発組織のための セキュアコーディング研修の始め方
flatt_security
3
1.4k
サーバーレスアーキテクチャと生成AIの融合 / Serverless Meets Generative AI
_kensh
12
3.1k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
4 Signs Your Business is Dying
shpigford
182
22k
Typedesign – Prime Four
hannesfritz
40
2.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
240
The Language of Interfaces
destraynor
156
24k
Statistics for Hackers
jakevdp
797
220k
The Pragmatic Product Professional
lauravandoore
32
6.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
GraphQLとの向き合い方2022年版
quramy
44
13k
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