Top Banner
UIAUTOMATOR Comment faire des tests d’intégration maison ?
28

Tests d'integration maisons avec UiAutomator

Jul 16, 2015

Download

Technology

Sidereo
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Tests d'integration maisons avec UiAutomator

UIAUTOMATOR

Comment faire des tests

d’intégration maison ?

Page 2: Tests d'integration maisons avec UiAutomator

QUI SUIS-JE ?

@kentin_dommerc

kentin.me

Développeur Android

Gandalf @sidereo

Page 3: Tests d'integration maisons avec UiAutomator

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

SOMMAIRE

Page 4: Tests d'integration maisons avec UiAutomator

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

Page 5: Tests d'integration maisons avec UiAutomator

C’EST QUOI ?

• Framework de tests

• Lib java/android

Page 6: Tests d'integration maisons avec UiAutomator

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

Page 7: Tests d'integration maisons avec UiAutomator

ÇA SERT À QUOI ?

• Tests fonctionnels basés sur l'UI

• Appuyer sur l’écran à ma place

• Automatiser des tâches

Page 8: Tests d'integration maisons avec UiAutomator

ÇA SERT À QUOI ?

Page 9: Tests d'integration maisons avec UiAutomator

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

Page 10: Tests d'integration maisons avec UiAutomator

COMMENT ÇA MARCHE ?

• Adb envoie et lance le test

• Le .jar contient les testcases

$> adb shell uiautomator runtest <file.jar>

$> adb push <file.jar>

Page 11: Tests d'integration maisons avec UiAutomator

COMMENT ÇA MARCHE ?

Page 12: Tests d'integration maisons avec UiAutomator

COMMENT ÇA MARCHE ?

Page 13: Tests d'integration maisons avec UiAutomator

COMMENT ÇA MARCHE ?

Page 14: Tests d'integration maisons avec UiAutomator

COMMENT ÇA MARCHE ?

Page 15: Tests d'integration maisons avec UiAutomator
Page 16: Tests d'integration maisons avec UiAutomator

DÉMO

Page 17: Tests d'integration maisons avec UiAutomator

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

Page 18: Tests d'integration maisons avec UiAutomator

LIMITATIONS

• Animations

• Accents sur 5.0 pas

pris en compte

• Dépendant des

éléments de la vue

(tablette vs

smartphone)

• Api Level 16

minimum et build

tools 21

• Fastidieux

(nouveau projet +

jars dans tout les

sens)

Page 19: Tests d'integration maisons avec UiAutomator

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

Page 20: Tests d'integration maisons avec UiAutomator

ALTERNATIVES

• Espresso : application sandbox

• Robotium : uzine à gaz + vieux

• Un humain

• Monkey (le script)

Page 21: Tests d'integration maisons avec UiAutomator

UIAUTOMATOR

• Framework de test indépendant d’une

application

• Contrôle sur le téléphone (screens…)

Page 22: Tests d'integration maisons avec UiAutomator

Wrapper en python :

https://github.com/xiaocong/uiautomator

BONUS :

Page 23: Tests d'integration maisons avec UiAutomator

BONUS #2:

Wrapper en java :

https://github.com/Sidereo/Droidcon-UIAutomator

Page 24: Tests d'integration maisons avec UiAutomator

Flavien Laurent blog post

flavienlaurent.com/blog/2014/12/05/screenshot_automation/

BONUS #3:

Page 25: Tests d'integration maisons avec UiAutomator

Daniel Lew’s blog post

http://daniel-codes.blogspot.com/2014/01/

testing-on-android-part-2-functional.html

BONUS #4:

Page 26: Tests d'integration maisons avec UiAutomator

Documentation Android

http://developer.android.com/tools/testing/

testing_ui.html#classes

BONUS #5:

Page 27: Tests d'integration maisons avec UiAutomator

CONCLUSION

C’est cool

Mais pas encore assez

Page 28: Tests d'integration maisons avec UiAutomator

QUESTIONS ?