tests d'integration maisons avec uiautomator

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

Upload: sidereo

Post on 16-Jul-2015

219 views

Category:

Technology


0 download

TRANSCRIPT

UIAUTOMATOR

Comment faire des tests

d’intégration maison ?

QUI SUIS-JE ?

@kentin_dommerc

kentin.me

Développeur Android

Gandalf @sidereo

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

SOMMAIRE

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

C’EST QUOI ?

• Framework de tests

• Lib java/android

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

ÇA SERT À QUOI ?

• Tests fonctionnels basés sur l'UI

• Appuyer sur l’écran à ma place

• Automatiser des tâches

ÇA SERT À QUOI ?

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

COMMENT ÇA MARCHE ?

• Adb envoie et lance le test

• Le .jar contient les testcases

$> adb shell uiautomator runtest <file.jar>

$> adb push <file.jar>

COMMENT ÇA MARCHE ?

COMMENT ÇA MARCHE ?

COMMENT ÇA MARCHE ?

COMMENT ÇA MARCHE ?

DÉMO

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

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)

• C’est quoi ?

• Ça sert à quoi ?

• Comment ça marche ?

• Limitations

• Y a quoi comme alternatives ?

ALTERNATIVES

• Espresso : application sandbox

• Robotium : uzine à gaz + vieux

• Un humain

• Monkey (le script)

UIAUTOMATOR

• Framework de test indépendant d’une

application

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

Wrapper en python :

https://github.com/xiaocong/uiautomator

BONUS :

BONUS #2:

Wrapper en java :

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

Flavien Laurent blog post

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

BONUS #3:

Daniel Lew’s blog post

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

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

BONUS #4:

Documentation Android

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

testing_ui.html#classes

BONUS #5:

CONCLUSION

C’est cool

Mais pas encore assez

QUESTIONS ?