SlideShare a Scribd company logo
1 of 42
Download to read offline
Espresso: What else ? 
Thomas Guerin 
Xebia France 
#Devoxx #AndroidEspresso @Tom404_
#Devoxx #AndroidEspresso @Tom404_
“My tests last hours !” 
#Devoxx #AndroidEspresso @Tom404_
“My tests last hours !” 
“Testing is sometimes complicated !” 
#Devoxx #AndroidEspresso @Tom404_
“My tests last hours !” 
“Testing is sometimes complicated !” 
“My tests randomly fail !” 
#Devoxx #AndroidEspresso @Tom404_
“My tests last hours !” 
“Testing is sometimes complicated !” 
“My tests randomly fail !” 
“I have to fix the tests for a simple modification in my code” 
#Devoxx #AndroidEspresso @Tom404_
“My tests last hours !” 
“Testing is sometimes complicated !” 
“My tests randomly fail !” 
“I have to fix the tests for a simple modification in my code” 
#Devoxx #AndroidEspresso @Tom404_
“My tests last hours !” 
“Testing is sometimes complicated !” 
“My tests randomly fail !” 
“I have to fix the tests for a simple modification in my code” 
#Devoxx #AndroidEspresso @Tom404_
“My tests last hours !” 
“Testing is sometimes complicated !” 
“My tests randomly fail !” 
“I have to fix the tests for a simple modification in my code” 
#Devoxx #AndroidEspresso @Tom404_
A test must be … 
#Devoxx #AndroidEspresso @Tom404_
A test must be … 
Simple 
#Devoxx #AndroidEspresso @Tom404_
A test must be … 
Simple Fast 
#Devoxx #AndroidEspresso @Tom404_
A test must be … 
Simple Fast Reliable 
#Devoxx #AndroidEspresso @Tom404_
A test must be … 
Simple Fast Reliable Durable 
#Devoxx #AndroidEspresso @Tom404_
Bad example 
// Start the main activity of the application under test 
mActivity = getActivity(); 
// Get a handle to the Activity object's main UI widget, a Spinner 
mSpinner = (Spinner)mActivity.findViewById(com.android.example.spinner.R.id.Spinner01); 
// Set the Spinner to a known position 
mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION); 
// Stop the activity -­‐ The onDestroy() method should save the state of the Spinner 
mActivity.finish(); 
// Re-­‐start the Activity -­‐ the onResume() method should restore the state of the Spinner 
mActivity = getActivity(); 
// Get the Spinner's current position 
int currentPosition = mActivity.getSpinnerPosition(); 
// Assert that the current position is the same as the starting position 
assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition); 
#Devoxx #AndroidEspresso @Tom404_
Bad example 
// Start the main activity of the application under test 
mActivity = getActivity(); 
// Get a handle to the Activity object's main UI widget, a Spinner 
mSpinner = (Spinner)mActivity.findViewById(com.android.example.spinner.R.id.Spinner01); 
// Set the Spinner to a known position 
mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION); 
// Stop the activity -­‐ The onDestroy() method should save the state of the Spinner 
mActivity.finish(); 
// Re-­‐start the Activity -­‐ the onResume() method should restore the state of the Spinner 
mActivity = getActivity(); 
// Get the Spinner's current position 
int currentPosition = mActivity.getSpinnerPosition(); 
// Assert that the current position is the same as the starting position 
assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition); 
#Devoxx #AndroidEspresso @Tom404_
Robotium 
#Devoxx #AndroidEspresso @Tom404_
API Overview 
#Devoxx #AndroidEspresso @Tom404_
API Overview 
clickInList(int line, int index) 
clickOnActionBarHome() 
clickOnButton(int index) 
searchText(String text) 
pressSoftKeyboardNextButton() 
setNavigationDrawer(int status) 
Solo 
getView(int viewId) 
drag(…) 
goBack() 
clickOnImageButton(int index) 
scrollDownList(int index) 
clickOnActionBarItem(int id) 
getButton(int index) 
clearEditText(int index) 
scrollDown() 
clickOnToggleButton(String text) 
scrollToBottom() searchEditText(String text) 
pressMenuItem(int index) 
pressSoftKeyboardSearchButton() 
#Devoxx #AndroidEspresso @Tom404_
Basic example 
solo.clickOnView(R.id.start_activity_button); 
// Wait for a specific condition to occur 
solo.waitForCondition(new Condition() { 
@Override 
public boolean isSatisfied() { 
return checkConditionInNewActivity(); 
} 
}, Timeout.getSmallTimeout()); 
solo.clickOnView(R.id.view_in_new_activity); 
#Devoxx #AndroidEspresso @Tom404_
Basic example 
solo.clickOnView(R.id.start_activity_button); 
// Wait for a specific condition to occur 
solo.waitForCondition(new Condition() { 
@Override 
public boolean isSatisfied() { 
return checkConditionInNewActivity(); 
} 
}, Timeout.getSmallTimeout()); 
solo.clickOnView(R.id.view_in_new_activity); 
#Devoxx #AndroidEspresso @Tom404_
Robotium drawbacks 
Flaky tests 
Hard to extend 
View index based methods 
Errors not meaningful 
#Devoxx #AndroidEspresso @Tom404_
Espresso 
#Devoxx #AndroidEspresso @Tom404_
Hamcrest 
#Devoxx #AndroidEspresso @Tom404_
Hamcrest 
Library of matchers 
#Devoxx #AndroidEspresso @Tom404_
Hamcrest 
Library of matchers 
assertThat("Hello", equalTo("Hello")) 
// Syntaxic sugar 
assertThat("Hello", is("Hello")) 
// A lot of matchers available 
allOf not instanceOf hasProperty equalToIgnoringCase 
#Devoxx #AndroidEspresso @Tom404_
Hamcrest 
Library of matchers 
assertThat("Hello", equalTo("Hello")) 
// Syntaxic sugar 
assertThat("Hello", is("Hello")) 
// A lot of matchers available 
allOf not instanceOf hasProperty equalToIgnoringCase 
Easy to compose 
#Devoxx #AndroidEspresso @Tom404_
Custom matcher 
public static Matcher<View> isVisible() { 
return new TypeSafeMatcher<View>() { 
@Override 
public void describeTo(Description description) { 
description.appendText("is view visible"); 
} 
@Override 
public boolean matchesSafely(View view) { 
return view.getVisibility() == View.VISIBLE; 
} 
}; 
} 
#Devoxx #AndroidEspresso @Tom404_
API overview 
#Devoxx #AndroidEspresso @Tom404_
API overview 
Espresso 
onView(Matcher<View>) 
onData(Matcher<Object> 
#Devoxx #AndroidEspresso @Tom404_
API overview 
ViewMatchers 
Espresso withId() 
onView(Matcher<View>) 
onData(Matcher<Object> 
withText(text) 
hasSibling(Matcher<View>) 
#Devoxx #AndroidEspresso @Tom404_
API overview 
Espresso 
onView(Matcher<View>) 
onData(Matcher<Object> 
ViewInteraction / DataInteraction 
perform(ViewAction) 
check(ViewAssertion) 
ViewMatchers 
withId() 
withText(text) 
hasSibling(Matcher<View>) 
#Devoxx #AndroidEspresso @Tom404_
API overview 
Espresso 
onView(Matcher<View>) 
onData(Matcher<Object> 
ViewInteraction / DataInteraction 
perform(ViewAction) 
check(ViewAssertion) 
ViewMatchers 
withId() 
withText(text) 
hasSibling(Matcher<View>) 
ViewActions 
click() 
typeText(text) 
#Devoxx #AndroidEspresso @Tom404_
API overview 
Espresso 
onView(Matcher<View>) 
onData(Matcher<Object> 
ViewInteraction / DataInteraction 
perform(ViewAction) 
check(ViewAssertion) 
ViewMatchers 
withId() 
withText(text) 
hasSibling(Matcher<View>) 
ViewActions 
click() 
typeText(text) 
ViewAssertions 
doesNotExist() 
matches(Matcher<View>) 
#Devoxx #AndroidEspresso @Tom404_
Goodbye flakiness 
#Devoxx #AndroidEspresso @Tom404_
Goodbye flakiness 
For each test action, Espresso will : 
#Devoxx #AndroidEspresso @Tom404_
Goodbye flakiness 
For each test action, Espresso will : 
1. Wait until the app is idle 
#Devoxx #AndroidEspresso @Tom404_
Goodbye flakiness 
For each test action, Espresso will : 
1. Wait until the app is idle 
2. Run on the UI thread 
#Devoxx #AndroidEspresso @Tom404_
Goodbye flakiness 
For each test action, Espresso will : 
1. Wait until the app is idle 
2. Run on the UI thread 
3. Wait until completion 
#Devoxx #AndroidEspresso @Tom404_
Goodbye flakiness 
For each test action, Espresso will : 
1. Wait until the app is idle 
2. Run on the UI thread 
3. Wait until completion 
4. Check the result 
#Devoxx #AndroidEspresso @Tom404_
Goodbye flakiness 
For each test action, Espresso will : 
1. Wait until the app is idle 
2. Run on the UI thread 
3. Wait until completion 
4. Check the result 
#Devoxx #AndroidEspresso @Tom404_
Demo 
#Devoxx #AndroidEspresso @Tom404_

More Related Content

What's hot

Mocks, Spies, and Timers - Oh My!
Mocks, Spies, and Timers - Oh My!Mocks, Spies, and Timers - Oh My!
Mocks, Spies, and Timers - Oh My!Lisa Backer
 
You do not need automation engineer - Sqa Days - 2015 - EN
You do not need automation engineer  - Sqa Days - 2015 - ENYou do not need automation engineer  - Sqa Days - 2015 - EN
You do not need automation engineer - Sqa Days - 2015 - ENIakiv Kramarenko
 
2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript SecurityJohannes Hoppe
 
Workshop 5: JavaScript testing
Workshop 5: JavaScript testingWorkshop 5: JavaScript testing
Workshop 5: JavaScript testingVisual Engineering
 
Django tips and_tricks (1)
Django tips and_tricks (1)Django tips and_tricks (1)
Django tips and_tricks (1)andymccurdy
 
More android code puzzles
More android code puzzlesMore android code puzzles
More android code puzzlesDanny Preussler
 
JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)Nicholas Zakas
 
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019GoQA
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the FinishYehuda Katz
 
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...Baruch Sadogursky
 

What's hot (17)

Testable Javascript
Testable JavascriptTestable Javascript
Testable Javascript
 
Mocks, Spies, and Timers - Oh My!
Mocks, Spies, and Timers - Oh My!Mocks, Spies, and Timers - Oh My!
Mocks, Spies, and Timers - Oh My!
 
Unit Test Fun
Unit Test FunUnit Test Fun
Unit Test Fun
 
Clean code
Clean codeClean code
Clean code
 
You do not need automation engineer - Sqa Days - 2015 - EN
You do not need automation engineer  - Sqa Days - 2015 - ENYou do not need automation engineer  - Sqa Days - 2015 - EN
You do not need automation engineer - Sqa Days - 2015 - EN
 
Unit testing UIView
Unit testing UIViewUnit testing UIView
Unit testing UIView
 
2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security
 
KISS Automation.py
KISS Automation.pyKISS Automation.py
KISS Automation.py
 
Workshop 5: JavaScript testing
Workshop 5: JavaScript testingWorkshop 5: JavaScript testing
Workshop 5: JavaScript testing
 
Django tips and_tricks (1)
Django tips and_tricks (1)Django tips and_tricks (1)
Django tips and_tricks (1)
 
More android code puzzles
More android code puzzlesMore android code puzzles
More android code puzzles
 
JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)JavaScript APIs you’ve never heard of (and some you have)
JavaScript APIs you’ve never heard of (and some you have)
 
Your code are my tests
Your code are my testsYour code are my tests
Your code are my tests
 
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS»  QADay 2019
МИХАЙЛО БОДНАРЧУК «SuperCharged End to End Testing with CodeceptJS» QADay 2019
 
Chainable datasource
Chainable datasourceChainable datasource
Chainable datasource
 
Rails 3: Dashing to the Finish
Rails 3: Dashing to the FinishRails 3: Dashing to the Finish
Rails 3: Dashing to the Finish
 
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
 

Similar to Espresso devoxx 2014

What's New in Android
What's New in AndroidWhat's New in Android
What's New in AndroidRobert Cooper
 
Android TV: Building apps with Google’s Leanback Library
Android TV: Building apps with  Google’s Leanback LibraryAndroid TV: Building apps with  Google’s Leanback Library
Android TV: Building apps with Google’s Leanback LibraryJoe Birch
 
Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014
Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014
Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014Paris Android User Group
 
iOS 개발자의 Flutter 체험기
iOS 개발자의 Flutter 체험기iOS 개발자의 Flutter 체험기
iOS 개발자의 Flutter 체험기Wanbok Choi
 
"Use Component Drivers to Control Components in Tests", Roman Shevchuk
"Use Component Drivers to Control Components in Tests", Roman Shevchuk "Use Component Drivers to Control Components in Tests", Roman Shevchuk
"Use Component Drivers to Control Components in Tests", Roman Shevchuk Fwdays
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on AndroidSven Haiges
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015Fernando Daciuk
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageabilityDaniel Fisher
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...solit
 
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...GreeceJS
 
Connect.js - Exploring React.Native
Connect.js - Exploring React.NativeConnect.js - Exploring React.Native
Connect.js - Exploring React.Nativejoshcjensen
 

Similar to Espresso devoxx 2014 (20)

iOS and Android apps automation
iOS and Android apps automationiOS and Android apps automation
iOS and Android apps automation
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in Android
 
Android TV: Building apps with Google’s Leanback Library
Android TV: Building apps with  Google’s Leanback LibraryAndroid TV: Building apps with  Google’s Leanback Library
Android TV: Building apps with Google’s Leanback Library
 
DroidCon 2014 - Robotium vs espresso_droidcon
DroidCon 2014 - Robotium vs espresso_droidconDroidCon 2014 - Robotium vs espresso_droidcon
DroidCon 2014 - Robotium vs espresso_droidcon
 
Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014
Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014
Robotium vs Espresso: Get ready to rumble ! - DroidCon Paris 2014
 
iOS 개발자의 Flutter 체험기
iOS 개발자의 Flutter 체험기iOS 개발자의 Flutter 체험기
iOS 개발자의 Flutter 체험기
 
Hooks WCSD12
Hooks WCSD12Hooks WCSD12
Hooks WCSD12
 
"Use Component Drivers to Control Components in Tests", Roman Shevchuk
"Use Component Drivers to Control Components in Tests", Roman Shevchuk "Use Component Drivers to Control Components in Tests", Roman Shevchuk
"Use Component Drivers to Control Components in Tests", Roman Shevchuk
 
Rhino Mocks
Rhino MocksRhino Mocks
Rhino Mocks
 
Android 3
Android 3Android 3
Android 3
 
CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
Device fragmentation vs clean code
Device fragmentation vs clean codeDevice fragmentation vs clean code
Device fragmentation vs clean code
 
WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015WordPress Realtime - WordCamp São Paulo 2015
WordPress Realtime - WordCamp São Paulo 2015
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
 
Connect.js - Exploring React.Native
Connect.js - Exploring React.NativeConnect.js - Exploring React.Native
Connect.js - Exploring React.Native
 

More from Publicis Sapient Engineering

XebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humain
XebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humainXebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humain
XebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humainPublicis Sapient Engineering
 
Xebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveur
Xebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveurXebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveur
Xebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveurPublicis Sapient Engineering
 
XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...
XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...
XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...Publicis Sapient Engineering
 
XebiCon'18 - Des notebook pour le monitoring avec Zeppelin
XebiCon'18 - Des notebook pour le monitoring avec Zeppelin XebiCon'18 - Des notebook pour le monitoring avec Zeppelin
XebiCon'18 - Des notebook pour le monitoring avec Zeppelin Publicis Sapient Engineering
 
XebiCon'18 - Event Sourcing et RGPD, incompatibles ?
XebiCon'18 - Event Sourcing et RGPD, incompatibles ?XebiCon'18 - Event Sourcing et RGPD, incompatibles ?
XebiCon'18 - Event Sourcing et RGPD, incompatibles ?Publicis Sapient Engineering
 
XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?
XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?
XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?Publicis Sapient Engineering
 
XebiCon'18 - Boostez vos modèles avec du Deep Learning distribué
XebiCon'18 - Boostez vos modèles avec du Deep Learning distribuéXebiCon'18 - Boostez vos modèles avec du Deep Learning distribué
XebiCon'18 - Boostez vos modèles avec du Deep Learning distribuéPublicis Sapient Engineering
 
XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...
XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...
XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...Publicis Sapient Engineering
 
XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !
XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !
XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !Publicis Sapient Engineering
 
XebiCon'18 - Comment fausser l'interprétation de vos résultats avec des dataviz
XebiCon'18 - Comment fausser l'interprétation de vos résultats avec des datavizXebiCon'18 - Comment fausser l'interprétation de vos résultats avec des dataviz
XebiCon'18 - Comment fausser l'interprétation de vos résultats avec des datavizPublicis Sapient Engineering
 
XebiCon'18 - Architecturer son application mobile pour la durabilité
XebiCon'18 - Architecturer son application mobile pour la durabilitéXebiCon'18 - Architecturer son application mobile pour la durabilité
XebiCon'18 - Architecturer son application mobile pour la durabilitéPublicis Sapient Engineering
 
XebiCon'18 - Sécuriser son API avec OpenID Connect
XebiCon'18 - Sécuriser son API avec OpenID ConnectXebiCon'18 - Sécuriser son API avec OpenID Connect
XebiCon'18 - Sécuriser son API avec OpenID ConnectPublicis Sapient Engineering
 
XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...
XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...
XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...Publicis Sapient Engineering
 
XebiCon'18 - La sécurité, douce illusion même en 2018
XebiCon'18 - La sécurité, douce illusion même en 2018XebiCon'18 - La sécurité, douce illusion même en 2018
XebiCon'18 - La sécurité, douce illusion même en 2018Publicis Sapient Engineering
 
XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...
XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...
XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...Publicis Sapient Engineering
 
XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...
XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...
XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...Publicis Sapient Engineering
 

More from Publicis Sapient Engineering (20)

XebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humain
XebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humainXebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humain
XebiCon'18 - L'algorithme de reconnaissance de formes par le cerveau humain
 
Xebicon'18 - IoT: From Edge to Cloud
Xebicon'18 - IoT: From Edge to CloudXebicon'18 - IoT: From Edge to Cloud
Xebicon'18 - IoT: From Edge to Cloud
 
Xebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveur
Xebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveurXebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveur
Xebicon'18 - Spark in jail : conteneurisez vos traitements data sans serveur
 
XebiCon'18 - Modern Infrastructure
XebiCon'18 - Modern InfrastructureXebiCon'18 - Modern Infrastructure
XebiCon'18 - Modern Infrastructure
 
XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...
XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...
XebiCon'18 - La Web App d'aujourd'hui et de demain : état de l'art et bleedin...
 
XebiCon'18 - Des notebook pour le monitoring avec Zeppelin
XebiCon'18 - Des notebook pour le monitoring avec Zeppelin XebiCon'18 - Des notebook pour le monitoring avec Zeppelin
XebiCon'18 - Des notebook pour le monitoring avec Zeppelin
 
XebiCon'18 - Event Sourcing et RGPD, incompatibles ?
XebiCon'18 - Event Sourcing et RGPD, incompatibles ?XebiCon'18 - Event Sourcing et RGPD, incompatibles ?
XebiCon'18 - Event Sourcing et RGPD, incompatibles ?
 
XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?
XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?
XebiCon'18 - Deno, le nouveau NodeJS qui inverse la tendance ?
 
XebiCon'18 - Boostez vos modèles avec du Deep Learning distribué
XebiCon'18 - Boostez vos modèles avec du Deep Learning distribuéXebiCon'18 - Boostez vos modèles avec du Deep Learning distribué
XebiCon'18 - Boostez vos modèles avec du Deep Learning distribué
 
XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...
XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...
XebiCon'18 - Comment j'ai développé un jeu vidéo avec des outils de développe...
 
XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !
XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !
XebiCon'18 - Les utilisateurs finaux, les oubliés de nos produits !
 
XebiCon'18 - Comment fausser l'interprétation de vos résultats avec des dataviz
XebiCon'18 - Comment fausser l'interprétation de vos résultats avec des datavizXebiCon'18 - Comment fausser l'interprétation de vos résultats avec des dataviz
XebiCon'18 - Comment fausser l'interprétation de vos résultats avec des dataviz
 
XebiCon'18 - Le développeur dans la Pop Culture
XebiCon'18 - Le développeur dans la Pop Culture XebiCon'18 - Le développeur dans la Pop Culture
XebiCon'18 - Le développeur dans la Pop Culture
 
XebiCon'18 - Architecturer son application mobile pour la durabilité
XebiCon'18 - Architecturer son application mobile pour la durabilitéXebiCon'18 - Architecturer son application mobile pour la durabilité
XebiCon'18 - Architecturer son application mobile pour la durabilité
 
XebiCon'18 - Sécuriser son API avec OpenID Connect
XebiCon'18 - Sécuriser son API avec OpenID ConnectXebiCon'18 - Sécuriser son API avec OpenID Connect
XebiCon'18 - Sécuriser son API avec OpenID Connect
 
XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...
XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...
XebiCon'18 - Structuration du Temps et Dynamique de Groupes, Théorie organisa...
 
XebiCon'18 - Spark NLP, un an après
XebiCon'18 - Spark NLP, un an aprèsXebiCon'18 - Spark NLP, un an après
XebiCon'18 - Spark NLP, un an après
 
XebiCon'18 - La sécurité, douce illusion même en 2018
XebiCon'18 - La sécurité, douce illusion même en 2018XebiCon'18 - La sécurité, douce illusion même en 2018
XebiCon'18 - La sécurité, douce illusion même en 2018
 
XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...
XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...
XebiCon'18 - Utiliser Hyperledger Fabric pour la création d'une blockchain pr...
 
XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...
XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...
XebiCon'18 - Ce que l'histoire du métro Parisien m'a enseigné sur la création...
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Espresso devoxx 2014

  • 1. Espresso: What else ? Thomas Guerin Xebia France #Devoxx #AndroidEspresso @Tom404_
  • 3. “My tests last hours !” #Devoxx #AndroidEspresso @Tom404_
  • 4. “My tests last hours !” “Testing is sometimes complicated !” #Devoxx #AndroidEspresso @Tom404_
  • 5. “My tests last hours !” “Testing is sometimes complicated !” “My tests randomly fail !” #Devoxx #AndroidEspresso @Tom404_
  • 6. “My tests last hours !” “Testing is sometimes complicated !” “My tests randomly fail !” “I have to fix the tests for a simple modification in my code” #Devoxx #AndroidEspresso @Tom404_
  • 7. “My tests last hours !” “Testing is sometimes complicated !” “My tests randomly fail !” “I have to fix the tests for a simple modification in my code” #Devoxx #AndroidEspresso @Tom404_
  • 8. “My tests last hours !” “Testing is sometimes complicated !” “My tests randomly fail !” “I have to fix the tests for a simple modification in my code” #Devoxx #AndroidEspresso @Tom404_
  • 9. “My tests last hours !” “Testing is sometimes complicated !” “My tests randomly fail !” “I have to fix the tests for a simple modification in my code” #Devoxx #AndroidEspresso @Tom404_
  • 10. A test must be … #Devoxx #AndroidEspresso @Tom404_
  • 11. A test must be … Simple #Devoxx #AndroidEspresso @Tom404_
  • 12. A test must be … Simple Fast #Devoxx #AndroidEspresso @Tom404_
  • 13. A test must be … Simple Fast Reliable #Devoxx #AndroidEspresso @Tom404_
  • 14. A test must be … Simple Fast Reliable Durable #Devoxx #AndroidEspresso @Tom404_
  • 15. Bad example // Start the main activity of the application under test mActivity = getActivity(); // Get a handle to the Activity object's main UI widget, a Spinner mSpinner = (Spinner)mActivity.findViewById(com.android.example.spinner.R.id.Spinner01); // Set the Spinner to a known position mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION); // Stop the activity -­‐ The onDestroy() method should save the state of the Spinner mActivity.finish(); // Re-­‐start the Activity -­‐ the onResume() method should restore the state of the Spinner mActivity = getActivity(); // Get the Spinner's current position int currentPosition = mActivity.getSpinnerPosition(); // Assert that the current position is the same as the starting position assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition); #Devoxx #AndroidEspresso @Tom404_
  • 16. Bad example // Start the main activity of the application under test mActivity = getActivity(); // Get a handle to the Activity object's main UI widget, a Spinner mSpinner = (Spinner)mActivity.findViewById(com.android.example.spinner.R.id.Spinner01); // Set the Spinner to a known position mActivity.setSpinnerPosition(TEST_STATE_DESTROY_POSITION); // Stop the activity -­‐ The onDestroy() method should save the state of the Spinner mActivity.finish(); // Re-­‐start the Activity -­‐ the onResume() method should restore the state of the Spinner mActivity = getActivity(); // Get the Spinner's current position int currentPosition = mActivity.getSpinnerPosition(); // Assert that the current position is the same as the starting position assertEquals(TEST_STATE_DESTROY_POSITION, currentPosition); #Devoxx #AndroidEspresso @Tom404_
  • 18. API Overview #Devoxx #AndroidEspresso @Tom404_
  • 19. API Overview clickInList(int line, int index) clickOnActionBarHome() clickOnButton(int index) searchText(String text) pressSoftKeyboardNextButton() setNavigationDrawer(int status) Solo getView(int viewId) drag(…) goBack() clickOnImageButton(int index) scrollDownList(int index) clickOnActionBarItem(int id) getButton(int index) clearEditText(int index) scrollDown() clickOnToggleButton(String text) scrollToBottom() searchEditText(String text) pressMenuItem(int index) pressSoftKeyboardSearchButton() #Devoxx #AndroidEspresso @Tom404_
  • 20. Basic example solo.clickOnView(R.id.start_activity_button); // Wait for a specific condition to occur solo.waitForCondition(new Condition() { @Override public boolean isSatisfied() { return checkConditionInNewActivity(); } }, Timeout.getSmallTimeout()); solo.clickOnView(R.id.view_in_new_activity); #Devoxx #AndroidEspresso @Tom404_
  • 21. Basic example solo.clickOnView(R.id.start_activity_button); // Wait for a specific condition to occur solo.waitForCondition(new Condition() { @Override public boolean isSatisfied() { return checkConditionInNewActivity(); } }, Timeout.getSmallTimeout()); solo.clickOnView(R.id.view_in_new_activity); #Devoxx #AndroidEspresso @Tom404_
  • 22. Robotium drawbacks Flaky tests Hard to extend View index based methods Errors not meaningful #Devoxx #AndroidEspresso @Tom404_
  • 25. Hamcrest Library of matchers #Devoxx #AndroidEspresso @Tom404_
  • 26. Hamcrest Library of matchers assertThat("Hello", equalTo("Hello")) // Syntaxic sugar assertThat("Hello", is("Hello")) // A lot of matchers available allOf not instanceOf hasProperty equalToIgnoringCase #Devoxx #AndroidEspresso @Tom404_
  • 27. Hamcrest Library of matchers assertThat("Hello", equalTo("Hello")) // Syntaxic sugar assertThat("Hello", is("Hello")) // A lot of matchers available allOf not instanceOf hasProperty equalToIgnoringCase Easy to compose #Devoxx #AndroidEspresso @Tom404_
  • 28. Custom matcher public static Matcher<View> isVisible() { return new TypeSafeMatcher<View>() { @Override public void describeTo(Description description) { description.appendText("is view visible"); } @Override public boolean matchesSafely(View view) { return view.getVisibility() == View.VISIBLE; } }; } #Devoxx #AndroidEspresso @Tom404_
  • 29. API overview #Devoxx #AndroidEspresso @Tom404_
  • 30. API overview Espresso onView(Matcher<View>) onData(Matcher<Object> #Devoxx #AndroidEspresso @Tom404_
  • 31. API overview ViewMatchers Espresso withId() onView(Matcher<View>) onData(Matcher<Object> withText(text) hasSibling(Matcher<View>) #Devoxx #AndroidEspresso @Tom404_
  • 32. API overview Espresso onView(Matcher<View>) onData(Matcher<Object> ViewInteraction / DataInteraction perform(ViewAction) check(ViewAssertion) ViewMatchers withId() withText(text) hasSibling(Matcher<View>) #Devoxx #AndroidEspresso @Tom404_
  • 33. API overview Espresso onView(Matcher<View>) onData(Matcher<Object> ViewInteraction / DataInteraction perform(ViewAction) check(ViewAssertion) ViewMatchers withId() withText(text) hasSibling(Matcher<View>) ViewActions click() typeText(text) #Devoxx #AndroidEspresso @Tom404_
  • 34. API overview Espresso onView(Matcher<View>) onData(Matcher<Object> ViewInteraction / DataInteraction perform(ViewAction) check(ViewAssertion) ViewMatchers withId() withText(text) hasSibling(Matcher<View>) ViewActions click() typeText(text) ViewAssertions doesNotExist() matches(Matcher<View>) #Devoxx #AndroidEspresso @Tom404_
  • 35. Goodbye flakiness #Devoxx #AndroidEspresso @Tom404_
  • 36. Goodbye flakiness For each test action, Espresso will : #Devoxx #AndroidEspresso @Tom404_
  • 37. Goodbye flakiness For each test action, Espresso will : 1. Wait until the app is idle #Devoxx #AndroidEspresso @Tom404_
  • 38. Goodbye flakiness For each test action, Espresso will : 1. Wait until the app is idle 2. Run on the UI thread #Devoxx #AndroidEspresso @Tom404_
  • 39. Goodbye flakiness For each test action, Espresso will : 1. Wait until the app is idle 2. Run on the UI thread 3. Wait until completion #Devoxx #AndroidEspresso @Tom404_
  • 40. Goodbye flakiness For each test action, Espresso will : 1. Wait until the app is idle 2. Run on the UI thread 3. Wait until completion 4. Check the result #Devoxx #AndroidEspresso @Tom404_
  • 41. Goodbye flakiness For each test action, Espresso will : 1. Wait until the app is idle 2. Run on the UI thread 3. Wait until completion 4. Check the result #Devoxx #AndroidEspresso @Tom404_