Automation test for Android
-
Upload
somkiat-puisungnoen -
Category
Technology
-
view
1.144 -
download
2
Transcript of Automation test for Android
![Page 1: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/1.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
somkiat.cc
Test Automation Meetup #1
![Page 2: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/2.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 3: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/3.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 4: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/4.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 5: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/5.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 6: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/6.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
http://blog.crisp.se/wp-content/uploads/2013/08/20130820-What-is-Agile.pdf
![Page 7: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/7.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
Testing is Activity
![Page 8: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/8.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
Show your testing activity
![Page 9: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/9.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
http://blog.crisp.se/wp-content/uploads/2013/08/20130820-What-is-Agile.pdf
![Page 10: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/10.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 11: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/11.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
Testing early & often
![Page 12: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/12.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
ทดสอบกันอย่างไร ?
![Page 13: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/13.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 14: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/14.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 15: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/15.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
http://testingtweaks.com/what-is-angile-testing/
![Page 16: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/16.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
Mobile app ?
![Page 17: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/17.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 18: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/18.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 19: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/19.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 20: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/20.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 21: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/21.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
https://developer.android.com/about/dashboards/index.html
![Page 22: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/22.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 23: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/23.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
ทดสอบกันอย่างไร ?
![Page 24: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/24.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 25: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/25.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 26: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/26.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 27: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/27.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 28: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/28.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
One phone to rule them all !!
![Page 29: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/29.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 30: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/30.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 31: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/31.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
มีิ่งดี ๆ มานําเสนอ !!
![Page 32: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/32.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
UI Automator
![Page 33: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/33.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 34: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/34.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
Android Testing Support Library
UI Automator
![Page 35: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/35.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 36: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/36.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
https://google.github.io/android-testing-support-library/docs/espresso/index.html
![Page 37: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/37.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
UI testing
ทําให้แน่ใจว่า App ใ้งานได้บน device ต่าง ๆ
![Page 38: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/38.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
UI testing
Looks good but can’t use !!
![Page 39: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/39.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
UI testing
ต้องการทดสอบการทํางานของ Activityใ้เวลาการทดสอบนาน
จํานวนการทดสอบมีเท่าที่จําเป็น
![Page 40: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/40.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Espresso ?
Android Testing Support Library
Simulate user interactions
Automatic synchronization of test action with app UI
![Page 41: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/41.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Espresso components
ViewMatcherViewAction
ViewAssertion
![Page 42: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/42.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Espresso
onView(ViewMatcher) .perform(ViewAction)
.check(ViewAssertion)
![Page 43: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/43.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Hello Espresso onView(ViewMatcher) .perform(ViewAction) .check(ViewAssertion)
![Page 44: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/44.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
ViewMatcher onView(withId(R.id.greet_button)) .perform(ViewAction) .check(ViewAssertion)
![Page 45: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/45.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
ViewAction onView(withId(R.id.greet_button)) .perform(click()) .check(ViewAssertion)
![Page 46: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/46.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
ViewAssertion onView(withId(R.id.greet_button)) .perform(click()) .check(matches(withText(“สวัสดี”)))
![Page 47: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/47.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
ViewAssertion onView(withId(R.id.state_button)) .perform(click()) .check(matches(not(isEnabled())))
![Page 48: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/48.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Hamcrest onView(withId(R.id.state_button)) .perform(click()) .check(matches(not(isEnabled())))
![Page 49: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/49.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Run test
$./gradlew clean cAT
![Page 50: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/50.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Show report
![Page 51: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/51.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Show coverage report
![Page 52: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/52.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
![Page 53: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/53.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Rotate screen
![Page 54: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/54.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Listview
![Page 55: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/55.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Espresso with onData
onData(ObjectMatcher) .DataOptions
.perform(ViewAction) .check(ViewAssertion)
![Page 56: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/56.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
![Page 57: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/57.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Espresso cheatsheet
https://google.github.io/android-testing-support-library/docs/espresso/cheatsheet/index.html
![Page 58: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/58.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Hamcrest cheatsheet
http://www.marcphilipp.de/downloads/posts/2013-01-02-hamcrest-quick-reference/Hamcrest-1.3.pdf
![Page 59: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/59.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
![Page 60: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/60.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
ต้องการบันทึก screenshot ล่ะ ?
![Page 61: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/61.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
https://github.com/fastlane/fastlane/tree/master/screengrab#readme
![Page 62: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/62.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
More testing
Monkey testing
http://developer.android.com/tools/help/monkey.html
![Page 63: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/63.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
Monkey testing
Stress testingCommand line tool
Random events
![Page 64: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/64.jpg)
บริษัท สยามํานาญกิจ จํากัด และเพ่ือนพ้องน้องพ่ี
How to use ?
$adb shell monkey -p <your package> -v <# of events>
![Page 65: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/65.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
Small step
![Page 66: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/66.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 67: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/67.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 68: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/68.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 69: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/69.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
L E G A C Y C O D E
![Page 70: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/70.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 71: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/71.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
![Page 72: Automation test for Android](https://reader030.fdocument.pub/reader030/viewer/2022020314/5876fe481a28abf3398b6c87/html5/thumbnails/72.jpg)
ครอบครัวสยามํานาญกิจ และเพ่ือนพ้องน้องพ่ี
https://www.eventpop.me/e/549