SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Íntel Software and Services Group
UsingespressoanduiautomatorEduardo 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
Intel Information Technology
“I choose a lazy person to do a hard job.
Because a lazy person will find an easy way to do it.”
- Bill Gates
4
Image by Karla Vidal @ http://www.flickr.com/photos/63721650@N00/3661526274
Creative Commons cc-by-2.0
Intel Software and Services Group 5
Challenges
AutomationFragmentation
Intel Software and Services Group 6
JUnit UI Automator
Android Testing Support Library
Intel Software and Services Group 8
JUnit
Intel Software and Services GroupIntel Information Technology
Android Testing Framework
9
• Special TestCases, Asserts e Mocks
• MoreAsserts
• ViewAsserts
• MockApplication
• MockContext
• MockContentProvider
• AndroidTestCase
• ActivityInstrumentationTestCase2
• ActivityUnitTestCase
• ApplicationTestCase
• InstrumentationTestCase
• ProviderTestCase
• ServiceTestCase
• SingleLaunchActivityTestCase
JUnit
Intel Software and Services Group
Instrumentation
10
• Android Components Context Access;
• Components Lifecycle Control;
• Component Loading Control;
• System Events (e.g.: Broadcasts)
• InstrumentationTestRunner
• AndroidJUnitRunner
• GoogleInstrumentationTestRunner
Intel Software and Services Group
Espresso
11
• Simplifies the UI Test
Process within your App
• Methods for:
• View matching
• Checks
• UI Events
Intel Software and Services Group 12
Espresso - Configuration
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
Desabilitar nas opções do desenvolvedor (no device):
• Window Animation Scale
• Transition Animation Scale
• Animator Duration Scale
Intel Software and Services Group 13
Espresso – Vilibra Case
• Virtual Librarian
• Help to remember the books I
lend
• How to automate the lend
details view?
• Class:
TestViewLendedBookDetailFlow
Intel Software and Services Group 14
Check the code!
Instrumented Test Package:
vilibra/app/src/main/androidTest/java/ecarrara/eng/vilibra/
Test Class:
TestViewLendedBookDetailFlow.java
Intel Software and Services Group
UI Automator
24
• Cross App Testing
• Instrumentation Based
• Interact with visible
elements using
descriptors (like text).
Intel Software and Services Group 25
UIAutomator - Configuração
build.gradle
É necessário inspecionar os componentes visuais das apps alvo para garantir que o
UIAutomator consiga localizá-los.
Isso significa ter labels de texto visíveis, a propriedade android:contentDescription
preenchida, ou ainda a propriedade android:hint (para EditTexts)
dependencies {
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-
v18:2.1.1'
}
Intel Software and Services Group
1. Extend the InstrumentationTestCase class.
2. Get an instance of UIDevice.
3. Use the method UIDevice.findObject() to get UIObjects and
execute Actions.
4. Use asserts to check the results.
26
UIAutomator – Primeiro Test Case
Intel Software and Services Group 27
UIAutomator - uiautomatorviewer
Intel Software and Services Group 28
UIAutomator – Vilibra Case
• New case: automate the entire
lend process test.
• Class: TestLendBookFlow
Intel Software and Services Group 29
Check the code!
Instrumented Test Package:
vilibra/app/src/main/androidTest/java/ecarrara/eng/vilibra/
Test Class:
TestLendBookFlow.java
Intel Software and Services Group 44
Fragmentation
Screen size/density variety
Different Processor
Many OS versions
Intel Software and Services Group 45
Intel Software and Services Group 46
Intel Software and Services Group 47
Intel Information Technology
What is next?
52
• Go ahead and automate your app testing!
• How to integrate continous integration and delivery with Android?
• Code Coverage
• Mocking
“If you don’t like testing your product, most likely your
customers won’t like to test it either.”
- Anonymous
Intel Software and Services Group 53
Intel Developer Zone
https://software.intel.com/en-us/android/app-testing
Intel Software and Services Group
Thanks!
54
+EduardoCarraraDeAraujo
https://www.facebook.com/ducarrara
@DuCarrara
br.linkedin.com/in/eduardocarrara/
ecarrara-araujo/vilibra
Intel Software and Services Group 55
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 56
Bonus References!
Android Testing Support Library (ATSL)
• Android Testing Support Library: https://google.github.io/android-testing-support-library/
• Release Announcement:
https://plus.google.com/+AndroidDevelopers/posts/SXVtgnoKcAY?linkId=17056826
Placeholder Footer Copy / BU Logo or Name Goes Here

Weitere ähnliche Inhalte

Was ist angesagt?

MPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_DocumentationMPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_Documentation
Xin Shao
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)
Ahsanul Karim
 

Was ist angesagt? (20)

Robotium Tutorial
Robotium TutorialRobotium Tutorial
Robotium Tutorial
 
Android testing
Android testingAndroid testing
Android testing
 
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
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
 
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
 
Automated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracerAutomated Historical Performance Analysis with kmemtracer
Automated Historical Performance Analysis with kmemtracer
 
DSDP Mobile Tools for Java Webinar
DSDP Mobile Tools for Java WebinarDSDP Mobile Tools for Java Webinar
DSDP Mobile Tools for Java Webinar
 
Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012Mobile App Testing ScanAgile 2012
Mobile App Testing ScanAgile 2012
 
Create your First Watchkit App
Create your First Watchkit AppCreate your First Watchkit App
Create your First Watchkit App
 
Test Automation On Android Platform Using Robotium
Test Automation On Android Platform Using RobotiumTest Automation On Android Platform Using Robotium
Test Automation On Android Platform Using Robotium
 
MPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_DocumentationMPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_Documentation
 
Android overview
Android overviewAndroid overview
Android overview
 
Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021Appium Mobile Testing: Nakov at BurgasConf - July 2021
Appium Mobile Testing: Nakov at BurgasConf - July 2021
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from Scratch
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
Testing Android App Bundle with Appium
Testing Android App Bundle with AppiumTesting Android App Bundle with Appium
Testing Android App Bundle with Appium
 
Getting started with dagger 2
Getting started with dagger 2Getting started with dagger 2
Getting started with dagger 2
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 
Sensors in Android (old)
Sensors in Android (old)Sensors in Android (old)
Sensors in Android (old)
 
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
 

Ähnlich wie Utilizando expresso uiautomator na automacao de testes em apps android

Priyanka Singh_testing_resume
Priyanka Singh_testing_resumePriyanka Singh_testing_resume
Priyanka Singh_testing_resume
Priyanka Singh
 

Ähnlich wie Utilizando expresso uiautomator na automacao de testes em apps android (20)

Testando Sua App Android na Nuvem
Testando Sua App Android na NuvemTestando Sua App Android na Nuvem
Testando Sua App Android na Nuvem
 
Testando Apps Android na Nuvem
Testando Apps Android na NuvemTestando Apps Android na Nuvem
Testando Apps Android na Nuvem
 
Testing Your App in the Cloud
Testing Your App in the CloudTesting Your App in the Cloud
Testing Your App in the Cloud
 
Desarrollo y testing de apps móviles con Intel XDK y Testdroid
Desarrollo y testing de apps móviles con Intel XDK y TestdroidDesarrollo y testing de apps móviles con Intel XDK y Testdroid
Desarrollo y testing de apps móviles con Intel XDK y Testdroid
 
Mobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingMobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & Testing
 
Unit Testing Using Mockito in Android (1).pdf
Unit Testing Using Mockito in Android (1).pdfUnit Testing Using Mockito in Android (1).pdf
Unit Testing Using Mockito in Android (1).pdf
 
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
 
Sqa Automation
Sqa AutomationSqa Automation
Sqa Automation
 
Android101
Android101Android101
Android101
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
 
Leveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge DevicesLeveraging Artificial Intelligence Processing on Edge Devices
Leveraging Artificial Intelligence Processing on Edge Devices
 
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...
 
Android Jumpstart Jfokus
Android Jumpstart JfokusAndroid Jumpstart Jfokus
Android Jumpstart Jfokus
 
19507334023_NURISMA Z.D._PPT P PRADANA.pptx
19507334023_NURISMA Z.D._PPT P PRADANA.pptx19507334023_NURISMA Z.D._PPT P PRADANA.pptx
19507334023_NURISMA Z.D._PPT P PRADANA.pptx
 
Failure is an Option: Scaling Resilient Feature Delivery
Failure is an Option: Scaling Resilient Feature DeliveryFailure is an Option: Scaling Resilient Feature Delivery
Failure is an Option: Scaling Resilient Feature Delivery
 
Priyanka Singh_testing_resume
Priyanka Singh_testing_resumePriyanka Singh_testing_resume
Priyanka Singh_testing_resume
 
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
 
Integrating AI in software quality in absence of a well-defined requirements
Integrating AI in software quality in absence of a well-defined requirementsIntegrating AI in software quality in absence of a well-defined requirements
Integrating AI in software quality in absence of a well-defined requirements
 
Test automation design patterns
Test automation design patternsTest automation design patterns
Test automation design patterns
 

Mehr von tdc-globalcode

Mehr von tdc-globalcode (20)

TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidadeTDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
 
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
 
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de SucessoTDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
 
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPATDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
 
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVinoTDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
 
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
 
TDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devicesTDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devices
 
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca PublicaTrilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
 
Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#
 
TDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case EasylocusTDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case Easylocus
 
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
 
TDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em GolangTDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em Golang
 
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QATDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
 
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendenciaTDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
 
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR ServiceTDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
 
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NETTDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
 
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
 
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
 
TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#
 
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor  em .Net CoreTDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor  em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Utilizando expresso uiautomator na automacao de testes em apps android

  • 1. Íntel Software and Services Group UsingespressoanduiautomatorEduardo 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
  • 4. Intel Information Technology “I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” - Bill Gates 4 Image by Karla Vidal @ http://www.flickr.com/photos/63721650@N00/3661526274 Creative Commons cc-by-2.0
  • 5. Intel Software and Services Group 5 Challenges AutomationFragmentation
  • 6. Intel Software and Services Group 6 JUnit UI Automator Android Testing Support Library
  • 7. Intel Software and Services Group 8 JUnit
  • 8. Intel Software and Services GroupIntel Information Technology Android Testing Framework 9 • Special TestCases, Asserts e Mocks • MoreAsserts • ViewAsserts • MockApplication • MockContext • MockContentProvider • AndroidTestCase • ActivityInstrumentationTestCase2 • ActivityUnitTestCase • ApplicationTestCase • InstrumentationTestCase • ProviderTestCase • ServiceTestCase • SingleLaunchActivityTestCase JUnit
  • 9. Intel Software and Services Group Instrumentation 10 • Android Components Context Access; • Components Lifecycle Control; • Component Loading Control; • System Events (e.g.: Broadcasts) • InstrumentationTestRunner • AndroidJUnitRunner • GoogleInstrumentationTestRunner
  • 10. Intel Software and Services Group Espresso 11 • Simplifies the UI Test Process within your App • Methods for: • View matching • Checks • UI Events
  • 11. Intel Software and Services Group 12 Espresso - Configuration 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 Desabilitar nas opções do desenvolvedor (no device): • Window Animation Scale • Transition Animation Scale • Animator Duration Scale
  • 12. Intel Software and Services Group 13 Espresso – Vilibra Case • Virtual Librarian • Help to remember the books I lend • How to automate the lend details view? • Class: TestViewLendedBookDetailFlow
  • 13. Intel Software and Services Group 14 Check the code! Instrumented Test Package: vilibra/app/src/main/androidTest/java/ecarrara/eng/vilibra/ Test Class: TestViewLendedBookDetailFlow.java
  • 14. Intel Software and Services Group UI Automator 24 • Cross App Testing • Instrumentation Based • Interact with visible elements using descriptors (like text).
  • 15. Intel Software and Services Group 25 UIAutomator - Configuração build.gradle É necessário inspecionar os componentes visuais das apps alvo para garantir que o UIAutomator consiga localizá-los. Isso significa ter labels de texto visíveis, a propriedade android:contentDescription preenchida, ou ainda a propriedade android:hint (para EditTexts) dependencies { androidTestCompile 'com.android.support.test:runner:0.3' androidTestCompile 'com.android.support.test:rules:0.3' androidTestCompile 'com.android.support.test.uiautomator:uiautomator- v18:2.1.1' }
  • 16. Intel Software and Services Group 1. Extend the InstrumentationTestCase class. 2. Get an instance of UIDevice. 3. Use the method UIDevice.findObject() to get UIObjects and execute Actions. 4. Use asserts to check the results. 26 UIAutomator – Primeiro Test Case
  • 17. Intel Software and Services Group 27 UIAutomator - uiautomatorviewer
  • 18. Intel Software and Services Group 28 UIAutomator – Vilibra Case • New case: automate the entire lend process test. • Class: TestLendBookFlow
  • 19. Intel Software and Services Group 29 Check the code! Instrumented Test Package: vilibra/app/src/main/androidTest/java/ecarrara/eng/vilibra/ Test Class: TestLendBookFlow.java
  • 20. Intel Software and Services Group 44 Fragmentation Screen size/density variety Different Processor Many OS versions
  • 21. Intel Software and Services Group 45
  • 22. Intel Software and Services Group 46
  • 23. Intel Software and Services Group 47
  • 24. Intel Information Technology What is next? 52 • Go ahead and automate your app testing! • How to integrate continous integration and delivery with Android? • Code Coverage • Mocking “If you don’t like testing your product, most likely your customers won’t like to test it either.” - Anonymous
  • 25. Intel Software and Services Group 53 Intel Developer Zone https://software.intel.com/en-us/android/app-testing
  • 26. Intel Software and Services Group Thanks! 54 +EduardoCarraraDeAraujo https://www.facebook.com/ducarrara @DuCarrara br.linkedin.com/in/eduardocarrara/ ecarrara-araujo/vilibra
  • 27. Intel Software and Services Group 55 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
  • 28. Intel Software and Services Group 56 Bonus References! Android Testing Support Library (ATSL) • Android Testing Support Library: https://google.github.io/android-testing-support-library/ • Release Announcement: https://plus.google.com/+AndroidDevelopers/posts/SXVtgnoKcAY?linkId=17056826
  • 29. Placeholder Footer Copy / BU Logo or Name Goes Here