SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
Íntel Software and Services Group
Android:testautomationworkshopEduardo Carrara
Developer Evangelist – Intel Developers Relations Division
Intel Software and Services Group
#AndroidOnIntel
2
+EduardoCarraraDeAraujo
https://www.facebook.com/ducarrara
@DuCarrara
br.linkedin.com/in/eduardocarrara/
ecarrara-araujo
Intel Software and Services Group 3
Objective
Practice the usage of test automation tools available in the
Android Framework through the following activities:
• Prepare the test environment for development and execution.
• Development of unit tests that run on the local JVM.
• Development of UI Tests with Espresso.
• Development of Cross Apps Tests with UI Automator.
• Running tests in the cloud with TestDroid.
Intel Software and Services Group 4
Requirements
• Android Studio 1.3+
• Test Device with Android 4.0+
• SDK Version 23
• Build Tools 23.0.0
• AppCompat-v7 23.3.0
Intel Software and Services Group 5
Base App - BeerWith
• Simple demo app to help you keep track of
what have you been drinking and with who.
• https://github.com/ecarrara-araujo/beer-with
• If you want to follow the workshop just clone
it and work on branch master.
• Check the branch ahead for the
implementations:
• Imasters-android-devconf-tests-workshop
Intel Software and Services Group
#1–CreatingyourfirstUnitTest
6
Intel Software and Services Group 7
#1 – Creating your first Unit Test
testCompile 'junit:junit:4.12'
• Add the Junit dependency to the app/build.gradle
Intel Software and Services Group 8
#1 – Creating your first Unit Test
Create these directories.
Intel Software and Services Group 9
#1 – Creating your first Unit Test
Intel Software and Services Group 10
#1 – Creating your first Unit Test
Intel Software and Services Group 11
#1 – Creating your first Unit Test
Intel Software and Services Group 12
#1 – Creating your first Unit Test
public class UtilityTest {
@Test
public void testGetDateFormattedTime() throws Exception {
String expectedDateFormat = "yyyy, MMMM dd";
Calendar calendar = Calendar.getInstance();
calendar.set(2015, 4 - 1, 3); //20150403
String expectedResult = (new SimpleDateFormat(expectedDateFormat)).format(calendar.getTime());
String result = Utility.getDateFormattedTime(calendar, expectedDateFormat);
assertEquals("Date was not correctly formatted.", expectedResult, result);
// testing a second format to be sure
expectedDateFormat = "dd MM yyyy";
expectedResult = (new SimpleDateFormat(expectedDateFormat)).format(calendar.getTime());
result = Utility.getDateFormattedTime(calendar, expectedDateFormat);
assertEquals("Date was not correctly formatted.", expectedResult, result);
}
}
Intel Software and Services Group 13
#1 – Creating your first Unit Test
$ ./gradlew testor
Intel Software and Services Group 14
#1 – Creating your first Unit Test
or
appbuildreportstestsdebugindex.html
Intel Software and Services Group
#2Testingtheuiwithespresso
15
Intel Software and Services Group 16
#2 Testing the ui with espresso
• App/build.gradle
defaultConfig {
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
dependencies {
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
}
• ./build.gradle
allprojects {
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.0.0' } }
Intel Software and Services Group 17
#2 Testing the ui with espresso
Intel Software and Services Group 18
#2 Testing the ui with espresso
Intel Software and Services Group 19
#2 Testing the ui with espresso
Here comes a whole lot of code…
Check the file:
BeerWithappsrcandroidTestjavabrengecarrarabeerwit
hBeerWithMainActivityInstrumentationTest.java
Intel Software and Services Group 20
#2 Testing the ui with espresso
or $ ./gradlew connectedCheck
Intel Software and Services Group 21
#2 Testing the ui with espresso
or
appbuildreportsandroidTestsconnectedindex.html
Intel Software and Services Group
#3CROssappTestingwithUIAutomator
22
Intel Software and Services Group 23
#3 Cross app Testing with UI Automator
• App/build.gradle
defaultConfig {
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
• ./build.gradle
allprojects {
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:23.0.0' } }
dependecies {
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestCompile 'org.hamcrest:hamcrest-integration:1.3'
}
Intel Software and Services Group 24
#3 Cross app Testing with UI Automator
Intel Software and Services Group 25
#3 Cross app Testing with UI Automator
Intel Software and Services Group 26
#3 Cross app Testing with UI Automator
Androidsdk/tools/uiautomatorviewer
Intel Software and Services Group 27
#3 Cross app Testing with UI Automator
Here comes a whole lot of code…
Check the file:
BeerWithappsrcandroidTestjavabrengecarrarabeerwit
hAddingBeerWithCompleteTestFlow.java
Intel Software and Services Group 28
#3 Cross app Testing with UI Automator
or $ ./gradlew connectedCheck
Intel Software and Services Group 29
or
Intel Software and Services Group 30
Intel Software and Services Group 31
Intel Software and Services Group 32
Intel Software and Services Group 33
Intel Software and Services Group 34
Intel Information Technology
What is next?
35
• Follow the guide and automate your tests!
• How to integrate continous integration and delivery with Android?
• Code Coverage
• Mocking
Intel Software and Services Group 36
Intel Developer Zone
https://software.intel.com/en-us/android/app-testing
Intel Software and Services Group
Thanks!
37
+EduardoCarraraDeAraujo
https://www.facebook.com/ducarrara
@DuCarrara
br.linkedin.com/in/eduardocarrara/
ecarrara-araujo/vilibra
Intel Software and Services Group 38
References
• Android Testing: https://developer.android.com/tools/testing/testing_android.html
• Android Unit Testing Support: http://tools.android.com/tech-docs/unit-testing-support
• UI Testing: https://developer.android.com/training/testing/ui-testing/index.html
• Android Testing Support Library: https://developer.android.com/tools/testing-support-
library
• Android Instrumentation:
http://developer.android.com/tools/testing/testing_android.html#Instrumentation
• Junit: http://junit.org
• Testdroid: http://testdroid.com
• Intel App Testing Page: https://software.intel.com/en-us/android/app-testing
Intel Software and Services Group 39
References
• Codelab Android Studio Testing: https://io2015codelabs.appspot.com/codelabs/android-
studio-testing#1
• Android Testing Blueprints: https://github.com/googlesamples/android-testing-
templates/tree/master/AndroidTestingBlueprint
• Testing on Android by Vincent Brison: http://vincentbrison.com/2015/08/05/testing-on-
android-part1-a-practical-approach/
• Android Developers Unit Testing Training:
https://developer.android.com/training/testing/unit-testing/index.html
• Android Testing Samples: https://github.com/googlesamples/android-testing/
• G+ Community: https://plus.google.com/communities/10515313437206298596
• Stack Overflow: http://stackoverflow.com/questions/tagged/android-testing
Intel Software and Services Group 40
References
• Espresso v2 Cheat Sheet - https://code.google.com/p/android-test-
kit/wiki/EspressoV2CheatSheet
Placeholder Footer Copy / BU Logo or Name Goes Here

Mais conteúdo relacionado

Mais procurados

Android testing
Android testingAndroid testing
Android testingBitbar
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using RobotiumMindfire Solutions
 
A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testingjotaemepereira
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingAgile Testing Alliance
 
Robotium at Android Only 2010-09-29
Robotium at Android Only 2010-09-29Robotium at Android Only 2010-09-29
Robotium at Android Only 2010-09-29Hugo Josefson
 
Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Daniel Knott
 
Inside Android Testing
Inside Android TestingInside Android Testing
Inside Android TestingFernando Cejas
 
Android Testing: An Overview
Android Testing: An OverviewAndroid Testing: An Overview
Android Testing: An OverviewSmartLogic
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!Édipo Souza
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android ApplicationsRody Middelkoop
 
Android UI Testing with uiautomator
Android UI Testing with uiautomatorAndroid UI Testing with uiautomator
Android UI Testing with uiautomatorJana Moudrá
 
Android development session 5 - Debug android studio
Android development   session 5 - Debug android studioAndroid development   session 5 - Debug android studio
Android development session 5 - Debug android studioFarabi Technology Middle East
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Abhijeet Vaikar
 
Testing on Android
Testing on AndroidTesting on Android
Testing on AndroidAri Lacenski
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & DependeciesÉdipo Souza
 
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànTech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànNexus FrontierTech
 

Mais procurados (20)

Android testing
Android testingAndroid testing
Android testing
 
Android Automation Using Robotium
Android Automation Using RobotiumAndroid Automation Using Robotium
Android Automation Using Robotium
 
A guide to Android automated testing
A guide to Android automated testingA guide to Android automated testing
A guide to Android automated testing
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
 
Robotium at Android Only 2010-09-29
Robotium at Android Only 2010-09-29Robotium at Android Only 2010-09-29
Robotium at Android Only 2010-09-29
 
Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012
 
Espresso
EspressoEspresso
Espresso
 
Inside Android Testing
Inside Android TestingInside Android Testing
Inside Android Testing
 
Android Testing: An Overview
Android Testing: An OverviewAndroid Testing: An Overview
Android Testing: An Overview
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
 
Getting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
 
Android testing part i
Android testing part iAndroid testing part i
Android testing part i
 
Android UI Testing with uiautomator
Android UI Testing with uiautomatorAndroid UI Testing with uiautomator
Android UI Testing with uiautomator
 
Android development session 5 - Debug android studio
Android development   session 5 - Debug android studioAndroid development   session 5 - Debug android studio
Android development session 5 - Debug android studio
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...
 
Testing on Android
Testing on AndroidTesting on Android
Testing on Android
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
 
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn ToànTech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
Tech Talk #5 : Android Automation Test with Espresso - Trần Văn Toàn
 
Android Lab
Android LabAndroid Lab
Android Lab
 

Destaque

A guideline for using hangouts on air for company collaboration
A guideline for using hangouts on air for company collaborationA guideline for using hangouts on air for company collaboration
A guideline for using hangouts on air for company collaborationMars Cyrillo
 
Indo além com Automação de Testes de Apps Android
Indo além com Automação de Testes de Apps AndroidIndo além com Automação de Testes de Apps Android
Indo além com Automação de Testes de Apps AndroidEduardo Carrara de Araujo
 
Qa workshop
Qa workshopQa workshop
Qa workshoptesthive
 
Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Bitbar
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Bitbar
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonTEST Huddle
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlowAiste Stikliute
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API TestingBruno Pedro
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobilesDurairaja
 

Destaque (12)

A guideline for using hangouts on air for company collaboration
A guideline for using hangouts on air for company collaborationA guideline for using hangouts on air for company collaboration
A guideline for using hangouts on air for company collaboration
 
Indo além com Automação de Testes de Apps Android
Indo além com Automação de Testes de Apps AndroidIndo além com Automação de Testes de Apps Android
Indo além com Automação de Testes de Apps Android
 
Qa workshop
Qa workshopQa workshop
Qa workshop
 
Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?Do You Enjoy Espresso in Android App Testing?
Do You Enjoy Espresso in Android App Testing?
 
Test api
Test apiTest api
Test api
 
Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?Different Android Test Automation Frameworks - What Works You the Best?
Different Android Test Automation Frameworks - What Works You the Best?
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
API Testing
API TestingAPI Testing
API Testing
 
Api testing
Api testingApi testing
Api testing
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobiles
 

Semelhante a Android Test Automation Workshop

Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI TestingShai Raiten
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosFlutter Agency
 
Testando Apps Android na Nuvem
Testando Apps Android na NuvemTestando Apps Android na Nuvem
Testando Apps Android na Nuvemtdc-globalcode
 
Mercury Testdirector8.0 using Slides
Mercury Testdirector8.0 using SlidesMercury Testdirector8.0 using Slides
Mercury Testdirector8.0 using Slidestelab
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Ukraine
 
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Imaginet
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationIRJET Journal
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicDavid Solivan
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceOleksii Prohonnyi
 
Qa case study
Qa case studyQa case study
Qa case studyhopperdev
 
IRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET Journal
 
Ian Sommerville, Software Engineering, 9th EditionCh 8
Ian Sommerville,  Software Engineering, 9th EditionCh 8Ian Sommerville,  Software Engineering, 9th EditionCh 8
Ian Sommerville, Software Engineering, 9th EditionCh 8Mohammed Romi
 
Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Buşra Deniz, CSM
 
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...Comunidade NetPonto
 
Moogilu qa-case study (Software Testing)
Moogilu qa-case study (Software Testing)Moogilu qa-case study (Software Testing)
Moogilu qa-case study (Software Testing)Jagadish Channagiri
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinRapidValue
 
System imolementation(Modern Systems Analysis and Design)
System imolementation(Modern Systems Analysis and Design)System imolementation(Modern Systems Analysis and Design)
System imolementation(Modern Systems Analysis and Design)United International University
 

Semelhante a Android Test Automation Workshop (20)

Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
Testando Apps Android na Nuvem
Testando Apps Android na NuvemTestando Apps Android na Nuvem
Testando Apps Android na Nuvem
 
Mercury Testdirector8.0 using Slides
Mercury Testdirector8.0 using SlidesMercury Testdirector8.0 using Slides
Mercury Testdirector8.0 using Slides
 
Gcs day1
Gcs day1Gcs day1
Gcs day1
 
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
GlobalLogic Test Automation Online TechTalk “Test Driven Development as a Per...
 
Testando Sua App Android na Nuvem
Testando Sua App Android na NuvemTestando Sua App Android na Nuvem
Testando Sua App Android na Nuvem
 
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
 
DevOps CI Automation Continuous Integration
DevOps CI Automation Continuous IntegrationDevOps CI Automation Continuous Integration
DevOps CI Automation Continuous Integration
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
 
Qa case study
Qa case studyQa case study
Qa case study
 
IRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional TestingIRJET- Automatic Device Functional Testing
IRJET- Automatic Device Functional Testing
 
Ian Sommerville, Software Engineering, 9th EditionCh 8
Ian Sommerville,  Software Engineering, 9th EditionCh 8Ian Sommerville,  Software Engineering, 9th EditionCh 8
Ian Sommerville, Software Engineering, 9th EditionCh 8
 
Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015Unit Testing on Android - Droidcon Berlin 2015
Unit Testing on Android - Droidcon Berlin 2015
 
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
 
Moogilu qa-case study (Software Testing)
Moogilu qa-case study (Software Testing)Moogilu qa-case study (Software Testing)
Moogilu qa-case study (Software Testing)
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in Kotlin
 
Code in the Cloud - December 8th 2014
Code in the Cloud - December 8th 2014Code in the Cloud - December 8th 2014
Code in the Cloud - December 8th 2014
 
System imolementation(Modern Systems Analysis and Design)
System imolementation(Modern Systems Analysis and Design)System imolementation(Modern Systems Analysis and Design)
System imolementation(Modern Systems Analysis and Design)
 

Mais de Eduardo Carrara de Araujo

Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...
Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...
Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...Eduardo Carrara de Araujo
 
Implementation of a Participatory Sensing Solution to Collect Data About Pave...
Implementation of a Participatory Sensing Solution to Collect Data About Pave...Implementation of a Participatory Sensing Solution to Collect Data About Pave...
Implementation of a Participatory Sensing Solution to Collect Data About Pave...Eduardo Carrara de Araujo
 

Mais de Eduardo Carrara de Araujo (17)

Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...
Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...
Só um appzinho aê!? - O guia de sobrevivência para o dev da ideia inovadora a...
 
Melhorando seu App com Kotlin e Testes
Melhorando seu App com Kotlin e TestesMelhorando seu App com Kotlin e Testes
Melhorando seu App com Kotlin e Testes
 
Android apps ci
Android apps ciAndroid apps ci
Android apps ci
 
2016 - Por que mobile?
2016 - Por que mobile?2016 - Por que mobile?
2016 - Por que mobile?
 
Testes: Por onde Começar?
Testes: Por onde Começar?Testes: Por onde Começar?
Testes: Por onde Começar?
 
Android ndk: Entering the native world
Android ndk: Entering the native worldAndroid ndk: Entering the native world
Android ndk: Entering the native world
 
Android NDK: Entrando no Mundo Nativo
Android NDK: Entrando no Mundo NativoAndroid NDK: Entrando no Mundo Nativo
Android NDK: Entrando no Mundo Nativo
 
Implementation of a Participatory Sensing Solution to Collect Data About Pave...
Implementation of a Participatory Sensing Solution to Collect Data About Pave...Implementation of a Participatory Sensing Solution to Collect Data About Pave...
Implementation of a Participatory Sensing Solution to Collect Data About Pave...
 
GDG ABC - Aventura 2015
GDG ABC - Aventura 2015GDG ABC - Aventura 2015
GDG ABC - Aventura 2015
 
Why mobile?
Why mobile?Why mobile?
Why mobile?
 
Android M - Getting Started
Android M - Getting StartedAndroid M - Getting Started
Android M - Getting Started
 
Começando com Android (#AndroidOnIntel)
Começando com Android (#AndroidOnIntel)Começando com Android (#AndroidOnIntel)
Começando com Android (#AndroidOnIntel)
 
Android Auto Basics
Android Auto BasicsAndroid Auto Basics
Android Auto Basics
 
Debugging in Android
Debugging in AndroidDebugging in Android
Debugging in Android
 
Android 101: Do Plano ao Play
Android 101: Do Plano ao PlayAndroid 101: Do Plano ao Play
Android 101: Do Plano ao Play
 
Testing Your App in the Cloud
Testing Your App in the CloudTesting Your App in the Cloud
Testing Your App in the Cloud
 
Android 101: Do Plano ao Play em 30 minutos
Android 101: Do Plano ao Play em 30 minutosAndroid 101: Do Plano ao Play em 30 minutos
Android 101: Do Plano ao Play em 30 minutos
 

Último

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Último (20)

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Android Test Automation Workshop

  • 1. Íntel Software and Services Group Android:testautomationworkshopEduardo Carrara Developer Evangelist – Intel Developers Relations Division
  • 2. Intel Software and Services Group #AndroidOnIntel 2 +EduardoCarraraDeAraujo https://www.facebook.com/ducarrara @DuCarrara br.linkedin.com/in/eduardocarrara/ ecarrara-araujo
  • 3. Intel Software and Services Group 3 Objective Practice the usage of test automation tools available in the Android Framework through the following activities: • Prepare the test environment for development and execution. • Development of unit tests that run on the local JVM. • Development of UI Tests with Espresso. • Development of Cross Apps Tests with UI Automator. • Running tests in the cloud with TestDroid.
  • 4. Intel Software and Services Group 4 Requirements • Android Studio 1.3+ • Test Device with Android 4.0+ • SDK Version 23 • Build Tools 23.0.0 • AppCompat-v7 23.3.0
  • 5. Intel Software and Services Group 5 Base App - BeerWith • Simple demo app to help you keep track of what have you been drinking and with who. • https://github.com/ecarrara-araujo/beer-with • If you want to follow the workshop just clone it and work on branch master. • Check the branch ahead for the implementations: • Imasters-android-devconf-tests-workshop
  • 6. Intel Software and Services Group #1–CreatingyourfirstUnitTest 6
  • 7. Intel Software and Services Group 7 #1 – Creating your first Unit Test testCompile 'junit:junit:4.12' • Add the Junit dependency to the app/build.gradle
  • 8. Intel Software and Services Group 8 #1 – Creating your first Unit Test Create these directories.
  • 9. Intel Software and Services Group 9 #1 – Creating your first Unit Test
  • 10. Intel Software and Services Group 10 #1 – Creating your first Unit Test
  • 11. Intel Software and Services Group 11 #1 – Creating your first Unit Test
  • 12. Intel Software and Services Group 12 #1 – Creating your first Unit Test public class UtilityTest { @Test public void testGetDateFormattedTime() throws Exception { String expectedDateFormat = "yyyy, MMMM dd"; Calendar calendar = Calendar.getInstance(); calendar.set(2015, 4 - 1, 3); //20150403 String expectedResult = (new SimpleDateFormat(expectedDateFormat)).format(calendar.getTime()); String result = Utility.getDateFormattedTime(calendar, expectedDateFormat); assertEquals("Date was not correctly formatted.", expectedResult, result); // testing a second format to be sure expectedDateFormat = "dd MM yyyy"; expectedResult = (new SimpleDateFormat(expectedDateFormat)).format(calendar.getTime()); result = Utility.getDateFormattedTime(calendar, expectedDateFormat); assertEquals("Date was not correctly formatted.", expectedResult, result); } }
  • 13. Intel Software and Services Group 13 #1 – Creating your first Unit Test $ ./gradlew testor
  • 14. Intel Software and Services Group 14 #1 – Creating your first Unit Test or appbuildreportstestsdebugindex.html
  • 15. Intel Software and Services Group #2Testingtheuiwithespresso 15
  • 16. Intel Software and Services Group 16 #2 Testing the ui with espresso • App/build.gradle defaultConfig { testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' } dependencies { androidTestCompile 'com.android.support.test:runner:0.3' androidTestCompile 'com.android.support.test:rules:0.3' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' } • ./build.gradle allprojects { configurations.all { resolutionStrategy.force 'com.android.support:support-annotations:23.0.0' } }
  • 17. Intel Software and Services Group 17 #2 Testing the ui with espresso
  • 18. Intel Software and Services Group 18 #2 Testing the ui with espresso
  • 19. Intel Software and Services Group 19 #2 Testing the ui with espresso Here comes a whole lot of code… Check the file: BeerWithappsrcandroidTestjavabrengecarrarabeerwit hBeerWithMainActivityInstrumentationTest.java
  • 20. Intel Software and Services Group 20 #2 Testing the ui with espresso or $ ./gradlew connectedCheck
  • 21. Intel Software and Services Group 21 #2 Testing the ui with espresso or appbuildreportsandroidTestsconnectedindex.html
  • 22. Intel Software and Services Group #3CROssappTestingwithUIAutomator 22
  • 23. Intel Software and Services Group 23 #3 Cross app Testing with UI Automator • App/build.gradle defaultConfig { testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' } • ./build.gradle allprojects { configurations.all { resolutionStrategy.force 'com.android.support:support-annotations:23.0.0' } } dependecies { androidTestCompile 'com.android.support.test:runner:0.3' androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1' androidTestCompile 'org.hamcrest:hamcrest-integration:1.3' }
  • 24. Intel Software and Services Group 24 #3 Cross app Testing with UI Automator
  • 25. Intel Software and Services Group 25 #3 Cross app Testing with UI Automator
  • 26. Intel Software and Services Group 26 #3 Cross app Testing with UI Automator Androidsdk/tools/uiautomatorviewer
  • 27. Intel Software and Services Group 27 #3 Cross app Testing with UI Automator Here comes a whole lot of code… Check the file: BeerWithappsrcandroidTestjavabrengecarrarabeerwit hAddingBeerWithCompleteTestFlow.java
  • 28. Intel Software and Services Group 28 #3 Cross app Testing with UI Automator or $ ./gradlew connectedCheck
  • 29. Intel Software and Services Group 29 or
  • 30. Intel Software and Services Group 30
  • 31. Intel Software and Services Group 31
  • 32. Intel Software and Services Group 32
  • 33. Intel Software and Services Group 33
  • 34. Intel Software and Services Group 34
  • 35. Intel Information Technology What is next? 35 • Follow the guide and automate your tests! • How to integrate continous integration and delivery with Android? • Code Coverage • Mocking
  • 36. Intel Software and Services Group 36 Intel Developer Zone https://software.intel.com/en-us/android/app-testing
  • 37. Intel Software and Services Group Thanks! 37 +EduardoCarraraDeAraujo https://www.facebook.com/ducarrara @DuCarrara br.linkedin.com/in/eduardocarrara/ ecarrara-araujo/vilibra
  • 38. Intel Software and Services Group 38 References • Android Testing: https://developer.android.com/tools/testing/testing_android.html • Android Unit Testing Support: http://tools.android.com/tech-docs/unit-testing-support • UI Testing: https://developer.android.com/training/testing/ui-testing/index.html • Android Testing Support Library: https://developer.android.com/tools/testing-support- library • Android Instrumentation: http://developer.android.com/tools/testing/testing_android.html#Instrumentation • Junit: http://junit.org • Testdroid: http://testdroid.com • Intel App Testing Page: https://software.intel.com/en-us/android/app-testing
  • 39. Intel Software and Services Group 39 References • Codelab Android Studio Testing: https://io2015codelabs.appspot.com/codelabs/android- studio-testing#1 • Android Testing Blueprints: https://github.com/googlesamples/android-testing- templates/tree/master/AndroidTestingBlueprint • Testing on Android by Vincent Brison: http://vincentbrison.com/2015/08/05/testing-on- android-part1-a-practical-approach/ • Android Developers Unit Testing Training: https://developer.android.com/training/testing/unit-testing/index.html • Android Testing Samples: https://github.com/googlesamples/android-testing/ • G+ Community: https://plus.google.com/communities/10515313437206298596 • Stack Overflow: http://stackoverflow.com/questions/tagged/android-testing
  • 40. Intel Software and Services Group 40 References • Espresso v2 Cheat Sheet - https://code.google.com/p/android-test- kit/wiki/EspressoV2CheatSheet
  • 41. Placeholder Footer Copy / BU Logo or Name Goes Here