36
Automating Android By Melvin Laguren

Automating android

Embed Size (px)

DESCRIPTION

Presentation on Automation and CI for Bay Area Android Developer Group MeetUp on March 25, 2014. Details here: http://bit.ly/NZjkMh

Citation preview

Page 1: Automating android

Automating Android!!

By Melvin Laguren

Page 2: Automating android

Traditional Testing Triangle

Page 3: Automating android

Unit Testing

• Checks A Single Use Case

• No Dependencies

• Fast

• Repeatable

Page 4: Automating android

Integration Tests

• Combining Units Together

• Data Dependency

• Test Multiple Things

• Slower

Page 5: Automating android

Functional Test

• Black Box Testing

• Describes What The System Does

Page 6: Automating android

5 Steps To Functional Testing

• Determination of the functionality

• Creation of test data

• Output based on test data

• Writing of test scenarios

• Comparison of actual and expected results

Page 7: Automating android

Automation Key

Page 8: Automating android

Mobile Testing Approach

Page 9: Automating android

Mobile Automation Approach

Page 10: Automating android

App AndroidManifest.xml res/ … src/ … tests/ AndroidManifest.xml res/ … src/ …

Unit Testing

Resources & Source For Main Application

Resources and Source For Tests

Page 11: Automating android

Automating Acceptance

Page 12: Automating android

Frameworks For Functional Tests

Page 13: Automating android

App AndroidManifest.xml res/ … src/ … tests/ AndroidManifest.xml res/ … src/ … features step_definitions/ support/

Acceptance Testing

App Android/ iOS/ features/ step_definitions/ support/

Page 14: Automating android

Feature: One Time Password

Scenario: User Sends OTP

Given I launch the OTP App Then I see the One Time Password And I see the time left And I see the Credential ID And I see the Send Code Button When I touch the Send Code Button Then I see the progress bar

Feature File

Page 15: Automating android

Feature: One Time Password

Scenario: User Sends OTP

Given I launch the OTP App Then I see the One Time Password And I see the time left And I see the Credential ID And I see the Send Code ButtonWhen I touch the Send Code Button Then I see the progress bar

Feature File

Page 16: Automating android

Feature: One Time Password

Scenario: User Sends OTP

Given I launch the OTP App When I touch the Send Code Button Then I see the progress bar

Feature File

Page 17: Automating android

Feature: One Time Password

Scenario: User Sends OTP

Given I launch the OTP App When I send the OTP Code Then the OTP Code is sent

Feature File

Page 18: Automating android

Given(/^I launch the OTP App$/) do app.launchend

When(/^I send the OTP Code$/) do OTPscreen.send_code end

Then(/^the OTP Code is sent$/) do OTPscreen.code_sent end

Step Definitions

Page 19: Automating android

Mobile Abstraction Layer

Page 20: Automating android

• Cross Platform, Open Source

• Supported By Xamarin

• Interact with native and hybrid apps

• Gestures

• Assertions

• Screenshots

• Requires Instrumented Build

Calabash

Page 21: Automating android

How It Works

Page 22: Automating android

• Cross Platform, Open Source

• Supported By Sauce Labs

• Interact with web, native and hybrid apps

• Gestures

• Assertions

• Screenshots

• Does Not Require Instrumented Build

Appium

Page 23: Automating android

How It Works

Page 24: Automating android

• Commercial Option by SOASTA

• Records gestures (Record and Playback)

• Image validation

• Visual Test Creation

TouchTest

Page 25: Automating android

• Commercial Option by SOASTA

• Records gestures (Record and Playback)

• Image validation

• Visual Test Creation

TouchTest

Page 26: Automating android

Common Issue

Page 27: Automating android

Emulator or Device

Page 28: Automating android

• Cost is a factor

• Functionality not dependent on device profile

• Latency

!

Use Emulator

Page 29: Automating android

• Test Dependent On Profile

• Functionality not dependent on device profile

• Latency

!

Use Device

Page 30: Automating android

Continuous Integration

Page 31: Automating android

Stage 1 Testing - Emulators

Page 32: Automating android

Stage 2 Testing - Devices

Page 33: Automating android

Another Approach

Page 34: Automating android

• www.sqaessentials.com

• www.calaba.sh => www.xamarin.com

• www.appium.io => www.saucelabs.com

• www.soasta.com

Links To Automation Tools

Page 35: Automating android

• www.junit.org

• www.rspec.info

• www.jbehave.org

• www.cukes.info

• http://jasmine.github.io

Links To Frameworks

Page 36: Automating android

• www.sqaessentials.com

[email protected]

• Twitter: @mlaguren

• github.com/mlaguren

Contacting Melvin