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
Screenshot your Entire App with Screengrab and ...
Search
Edward Dale
November 03, 2016
Technology
0
420
Screenshot your Entire App with Screengrab and Firebase
Presentation from the GDG Munich Android meetup
Edward Dale
November 03, 2016
Tweet
Share
More Decks by Edward Dale
See All by Edward Dale
Write your own ProGuard
scompt
1
190
ProGuard
scompt
1
470
Screenshot your Entire App
scompt
1
1.9k
Reactive In-App Billing on Android
scompt
2
280
Fitness Motion Recognition with Android Wear
scompt
1
400
Android Apps with Mortar and Flow
scompt
7
1.6k
Functional Reactive Programming in the Mobile World
scompt
2
320
Other Decks in Technology
See All in Technology
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
190
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
200
Terraform Stacks入門 #HashiTalks
msato
0
350
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
240
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Building Adaptive Systems
keathley
38
2.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Building Applications with DynamoDB
mza
90
6.1k
Building an army of robots
kneath
302
43k
Producing Creativity
orderedlist
PRO
341
39k
What's new in Ruby 2.0
geeforr
343
31k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Transcript
Screenshot your Entire App Edward Dale Freeletics © Edward Dale,
2016 1
Screenshot your Entire App with Screengrab and Firebase Edward Dale
Freeletics © Edward Dale, 2016 2
Find the bug(s) © Edward Dale, 2016 3
© Edward Dale, 2016 4
© Edward Dale, 2016 5
Some things are best verified visually ! Screenshot © Edward
Dale, 2016 6
Screenshots are useful for • Acceptance testing • Edge case
• Localization • Multiple devices • Regression testing © Edward Dale, 2016 7
Screenshot testing tools • Espresso tests • Dependency injection •
Dependency mocking • Screengrab • Firebase Cloud Test Lab for Android © Edward Dale, 2016 8
Espresso test setup @MediumTest public class BuyCoachScreenGrab { @Inject DummyUserManager
mUserManager; @Rule public ActivityTestRule<BuyCoachActivity> mActivityRule = new ActivityTestRule<>(BuyCoachActivity.class, false, false); © Edward Dale, 2016 9
Automated localized screenshots of your Android app on every device
Screengrab ▶ Fastlane ▶ Fabric ▶ Twitter Combination of command-line tool and classes used in tests © Edward Dale, 2016 10
Screengrab test @Test public void testTestimonialMale() { when(mUserManager.getUser().getGender()).thenReturn(Gender.MALE); mActivityRule.launchActivity(new Intent());
onView(withId(R.id.feature_pager_videos)).perform(scrollTo()); Screengrab.screenshot("buy_coach_male_testimonial"); } © Edward Dale, 2016 11
Screengrab test @Test public void testTestimonialMale() { when(mUserManager.getUser().getGender()).thenReturn(Gender.MALE); mActivityRule.launchActivity(new Intent());
onView(withId(R.id.feature_pager_videos)).perform(scrollTo()); Screengrab.screenshot("buy_coach_male_testimonial"); } @Test public void testTestimonialFemale() { when(mUserManager.getUser().getGender()).thenReturn(Gender.FEMALE); mActivityRule.launchActivity(new Intent()); onView(withId(R.id.feature_pager_videos)).perform(scrollTo()); Screengrab.screenshot("buy_coach_female_testimonial"); } © Edward Dale, 2016 12
Screengrab configuration app_package_name 'com.freeletics.debug' app_apk_path 'Freeletics-debug.apk' tests_apk_path 'Freeletics-debug-androidTest.apk' locales ['en-US',
'fr-FR', 'it-IT', 'de-DE', 'pt-PT', 'es-ES', 'tr-TR', 'ja-JA'] use_tests_in_classes ['com.freeletics.coach.view.BuyCoachScreenGrab'] © Edward Dale, 2016 13
Running Screengrab $ ./gradlew clean assembleDebug assembleDebugTest $ screengrab ©
Edward Dale, 2016 14
Firebase Cloud Test Lab for Android Test your app on
devices hosted in a Google datacenter. Combination of command-line tool and classes used in tests Also supports virtual devices © Edward Dale, 2016 15
Firebase Cloud Test Lab for Android Test your app on
devices hosted in a Google datacenter. Combination of command-line tool and classes used in tests Also supports virtual devices $€£¥ © Edward Dale, 2016 16
Firebase test @Test public void testTestimonialMale() { when(mUserManager.getUser().getGender()).thenReturn(Gender.MALE); Activity activity
= mActivityRule.launchActivity(new Intent()); onView(withId(R.id.feature_pager_videos)).perform(scrollTo()); ScreenShotter.takeScreenshot("buy_coach_male_testimonial", activity); } © Edward Dale, 2016 17
Screengrab Screengrab.screenshot("buy_coach_male_testimonial"); Firebase ScreenShotter.takeScreenshot("buy_coach_male_testimonial", activity); © Edward Dale, 2016 18
Running Firebase gcloud beta test android run --type instrumentation --app
Freeletics-debug.apk --test Freeletics-debug-androidTest.apk --device-ids Nexus6 --os-version-ids 21 --locales en-US,fr-FR,it-IT,de-DE,pt-PT,es-ES,tr-TR,ja-JA --orientations portrait --test-targets "class com.freeletics.coach.view.BuyCoachScreenGrab" Also possible to stick this in a YML configuration file. © Edward Dale, 2016 19
Screengrab vs Firebase Fight! © Edward Dale, 2016 20
Screengrab • ✅ Free • ✅ No waiting for a
free device • ❌ Limited by your devices © Edward Dale, 2016 21
Firebase • ✅ Easy to setup a test matrix •
✅ Fits well with a CI system • ❌ Have to wait your turn • ❌ Costs money • $5/hour for real device • $1/hour for virtual device © Edward Dale, 2016 22
My suggestion Use both © Edward Dale, 2016 23
Cross-platform test @Test public void testTestimonialMale() { when(mUserManager.getUser().getGender()).thenReturn(Gender.MALE); Activity activity
= mActivityRule.launchActivity(new Intent()); onView(withId(R.id.feature_pager_videos)).perform(scrollTo()); ScreenShotter.takeScreenshot("buy_coach_male_testimonial", activity); Screengrab.screenshot("buy_coach_male_testimonial"); } Screengrab for daily development Firebase for CI regression testing © Edward Dale, 2016 24
Thanks! Edward Dale (@scompt) Freeletics (We're hiring) © Edward Dale,
2016 25