Continuous Testing on Emulators
Using the Espresso Test Automation
Framework
Clint Sprauve, Product Marketing Director, Mobile
Chandra Yalangi, Product Manager EMU/SIM, Sauce Connect
THE CHALLENGES OF MOBILE TEST AUTOMATION
2
MASSIVE VARIABILITY MAKES MOBILE TESTING COMPLEX
Web
Hybrid
Native
Device
Fragmentation
Various
App Types
Geographically
Dispersed
Users
WHY MOBILE TEST AUTOMATION FRAMEWORKS?
3
Appium
6
Benefits of Using Real Devices:
Benefits of Using Emulators & Simulators….
● Massive parallel concurrency for fastest build times
● Common OS/browser versions
● Price sensitivity
● Extremely low error rates
● Immediate availability supports CI/CD
● New Device and OS support within a week
● Custom OS and browser
● Pixel perfect display testing
● Hardware dependencies
● Panel/compatibility testing
● Replicate an issue on the exact model
Device Testing (on Wi-Fi
Networks + Networks
Simulation Tools)
Private
Device
(high security
& flexibility)
Public Device
(extensive coverage, optimal
for manual, exploratory, triage)
Emulator & Simulator
(scalability, resilience, price)
Different Needs Require Different Solutions
6/27/18 © Sauce Labs, Inc.
Access to a scalable testing platform enables you:
• Run tests in parallel to speed releases
• Test more scenarios per unit of time
7
Parallel Testing (1
minute)
Serial Testing (9
minutes)
iOS Device
1
iOS
Device2
iOS
Device3
Android
1
Android
2
Android
3
Emu/sim
1
Emu/sim
2
Emu/sim
3
iOS Device
1
iOS Device
2
iOS Device
3
Android
1
Android
2
Android
3
Emu/sim
1
Emu/sim
2
Emu/sim
3
Massive Parallel Execution at Scale
Espresso
What is Espresso?
Test Automation Framework from Google
Targeted at Developers
To Test Mobile Applications on Android
Example
Valid Credentials
Invalid Credentials
Account Locked
Mobile App
Test
Username
PasswordBusiness
Logic
Black Box Testing
1. Valid user
2. Locked user
• Flaky, Slow tests
Mobile App
Test
Username
Password
Test_Valid_Login
Test_Invalid_Login
• Close to real world scenario
Gray Box Testing
Mobile App
Test
Username
PasswordBusiness
Logic
Mock
Business
Logic
Test_Valid_Login
Test_Invalid_Login
• Reliable, Fast tests • Don’t test all components
E-commerce Flow
Sign In Add to Cart
Shipment
Details
Checkout
Espresso
Test Type Supported by Espresso?
Black Box Testing Yes
Gray Box Testing Yes, True power of Espresso
Test Pyramid
Unit Tests
Gray Box UI
Tests
E2E
Number of tests
Fidelity
Execution Time
Appium vs. Espresso
Appium vs. Espresso
Framework Native App Hybrid App Mobile Web
Espresso (Android Only)
Appium (iOS and Android)
Appium vs. Espresso
Language Appium Espresso
Java
Kotlin
JavaScript
Python
Ruby
Objective C
C#
PHP
Speed of Execution
Espresso vs. Appium
Local Emulator Espresso 2x faster
Remote Emulator Espresso ~5x faster
Test Synchronization
Appium Burden is on test developers
Espresso Framework handles this behind the scenes
Demo
Espresso on Emulators
>sauce-runner-virtual
AUT.apk
suite.apk
-d “Google Pixel”
-d “Samsung S8”
Device1: Test1 Pass
Device1: Test2 Pass
Device2: Test1 Fail
Device2: Test2 Pass
CUSTOMER NETWORK SAUCE NETWORK
⟳ adb suite ⟳ adb suite
All Tests Completed
Demo
Emulators and Simulators Roadmap
Framework Q4-18 H1-19
Espresso
XCUITest
Screenshots
Beta
Test level parallelization
Q&A

Continuous testing on emulators using the espresso test automation framework

  • 1.
    Continuous Testing onEmulators Using the Espresso Test Automation Framework Clint Sprauve, Product Marketing Director, Mobile Chandra Yalangi, Product Manager EMU/SIM, Sauce Connect
  • 2.
    THE CHALLENGES OFMOBILE TEST AUTOMATION 2 MASSIVE VARIABILITY MAKES MOBILE TESTING COMPLEX Web Hybrid Native Device Fragmentation Various App Types Geographically Dispersed Users
  • 3.
    WHY MOBILE TESTAUTOMATION FRAMEWORKS? 3 Appium
  • 4.
    6 Benefits of UsingReal Devices: Benefits of Using Emulators & Simulators…. ● Massive parallel concurrency for fastest build times ● Common OS/browser versions ● Price sensitivity ● Extremely low error rates ● Immediate availability supports CI/CD ● New Device and OS support within a week ● Custom OS and browser ● Pixel perfect display testing ● Hardware dependencies ● Panel/compatibility testing ● Replicate an issue on the exact model Device Testing (on Wi-Fi Networks + Networks Simulation Tools) Private Device (high security & flexibility) Public Device (extensive coverage, optimal for manual, exploratory, triage) Emulator & Simulator (scalability, resilience, price) Different Needs Require Different Solutions
  • 5.
    6/27/18 © SauceLabs, Inc. Access to a scalable testing platform enables you: • Run tests in parallel to speed releases • Test more scenarios per unit of time 7 Parallel Testing (1 minute) Serial Testing (9 minutes) iOS Device 1 iOS Device2 iOS Device3 Android 1 Android 2 Android 3 Emu/sim 1 Emu/sim 2 Emu/sim 3 iOS Device 1 iOS Device 2 iOS Device 3 Android 1 Android 2 Android 3 Emu/sim 1 Emu/sim 2 Emu/sim 3 Massive Parallel Execution at Scale
  • 6.
  • 7.
    What is Espresso? TestAutomation Framework from Google Targeted at Developers To Test Mobile Applications on Android
  • 8.
    Example Valid Credentials Invalid Credentials AccountLocked Mobile App Test Username PasswordBusiness Logic
  • 9.
    Black Box Testing 1.Valid user 2. Locked user • Flaky, Slow tests Mobile App Test Username Password Test_Valid_Login Test_Invalid_Login • Close to real world scenario
  • 10.
    Gray Box Testing MobileApp Test Username PasswordBusiness Logic Mock Business Logic Test_Valid_Login Test_Invalid_Login • Reliable, Fast tests • Don’t test all components
  • 11.
    E-commerce Flow Sign InAdd to Cart Shipment Details Checkout
  • 12.
    Espresso Test Type Supportedby Espresso? Black Box Testing Yes Gray Box Testing Yes, True power of Espresso
  • 13.
    Test Pyramid Unit Tests GrayBox UI Tests E2E Number of tests Fidelity Execution Time
  • 14.
  • 15.
    Appium vs. Espresso FrameworkNative App Hybrid App Mobile Web Espresso (Android Only) Appium (iOS and Android)
  • 16.
    Appium vs. Espresso LanguageAppium Espresso Java Kotlin JavaScript Python Ruby Objective C C# PHP
  • 17.
    Speed of Execution Espressovs. Appium Local Emulator Espresso 2x faster Remote Emulator Espresso ~5x faster
  • 18.
    Test Synchronization Appium Burdenis on test developers Espresso Framework handles this behind the scenes
  • 19.
  • 20.
    Espresso on Emulators >sauce-runner-virtual AUT.apk suite.apk -d“Google Pixel” -d “Samsung S8” Device1: Test1 Pass Device1: Test2 Pass Device2: Test1 Fail Device2: Test2 Pass CUSTOMER NETWORK SAUCE NETWORK ⟳ adb suite ⟳ adb suite All Tests Completed
  • 21.
  • 22.
    Emulators and SimulatorsRoadmap Framework Q4-18 H1-19 Espresso XCUITest Screenshots Beta Test level parallelization
  • 23.