Top Banner
Tips for stable UI Testing #5.2 Creators Learning English Meetup for Mobile by @Kazu_cocoa
24

20170529 clem kazuaki_matsuo

Jan 23, 2018

Download

Software

Kazuaki MATSUO
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: 20170529 clem kazuaki_matsuo

Tips for stable UI Testing#5.2 Creators Learning English Meetup for Mobile

by @Kazu_cocoa

Page 2: 20170529 clem kazuaki_matsuo

Kazuaki Matsuo( @Kazu_cocoa)

🏢: Cookpad Inc.

Test Engineer / Software Engineer in Quality

Lang: / / /

Maintainer: Appium Ruby binding

Page 3: 20170529 clem kazuaki_matsuo

Have you heard the word,flaky tests?

Page 4: 20170529 clem kazuaki_matsuo

Do you know offlaky tests?

Page 5: 20170529 clem kazuaki_matsuo

A definition

We define a "flaky" test result as a testthat exhibits both a passing anda failing result with the same code.

by John Micro

http://www.cs.umd.edu/~atif/pubs/gao-icse15.pdfhttps://testing.googleblog.com/2016/05/flaky-tests-at-google-and-how-we.html

Page 6: 20170529 clem kazuaki_matsuo

User Interface Testing

Page 7: 20170529 clem kazuaki_matsuo

User Interface Testing

User interface (UI) testing lets you ensure that your app meets its functional requirements and achieves a high standard of quality such that it is more likely to be successfully adopted by users.

https://developer.android.com/training/testing/ui-testing/index.html

Page 8: 20170529 clem kazuaki_matsuo

User Interface Testing

One approach to UI testing is to simply have a human tester perform a set of user operations on the target app and verify that it is behaving correctly.

https://developer.android.com/training/testing/ui-testing/index.html

Page 9: 20170529 clem kazuaki_matsuo

User Interface TestingA more efficient approach is to write your UI tests such that user actions are performed in an automated way. The automated approach allows you to run your tests quickly and reliably in a repeatable manner.

https://developer.android.com/training/testing/ui-testing/index.html

Page 10: 20170529 clem kazuaki_matsuo

Automated UI tests have many flakinesses

Page 11: 20170529 clem kazuaki_matsuo

Flakinesses in UI Tests

• animations• network• and other environments…

Page 12: 20170529 clem kazuaki_matsuo

Flakinesses in UI Tests

• animations• network• and other environments…

Page 13: 20170529 clem kazuaki_matsuo

How to reduce the flakiness

https://developer.android.com/training/testing/ui-testing/espresso-testing.html

Page 14: 20170529 clem kazuaki_matsuo

Only by manual

Page 15: 20170529 clem kazuaki_matsuo

Can’t we automate it,can we?

Page 16: 20170529 clem kazuaki_matsuo

Yes, we can.

Page 17: 20170529 clem kazuaki_matsuo

Automation at Cookpad

http://techlife.cookpad.com/entry/2016/08/13/test-size-for-mobile

Page 18: 20170529 clem kazuaki_matsuo

adb commands

$ add shell settings put global window_animation_scale 0

$ add shell settings put global transition_animation_scale 0

$ add shell settings put global animator_duration_scale 0

https://github.com/KazuCocoa/droid_adbs

Page 19: 20170529 clem kazuaki_matsuo

Via API

https://github.com/KazuCocoa/DroidTestHelper

Page 20: 20170529 clem kazuaki_matsuo

For iOS Engineers

Page 21: 20170529 clem kazuaki_matsuo

We can implement similar tips for the iOS platform

Page 22: 20170529 clem kazuaki_matsuo

With EarlGrey

Page 23: 20170529 clem kazuaki_matsuo

Step into enableFastAnimation

https://github.com/google/EarlGreyhttps://developer.apple.com/reference/quartzcore/camediatiming/1427647-speed

Page 24: 20170529 clem kazuaki_matsuo

Have a good CLEM time