24
Tips for Android Test Support Library 1.0 Android Test Night #2 by @Kazu_cocoa

20171215 andoird-test-night

Embed Size (px)

Citation preview

Tips forAndroid Test Support Library 1.0

Android Test Night #2by @Kazu_cocoa

Kazuaki Matsuo( @Kazu_cocoa)

🏢: Cookpad Inc.

International Group

Software Engineer in Quality

Programming Language

OSS

https://www.nikkan.co.jp/releases/view/15984

A bunch of new features / improvements

Items

• IdlingResource• Parametrized testing• GrantPermissionRule• Android Test Orchestrator• Tips

IdlingResource

Parametrized Testing

JUnit4

• https://github.com/junit-team/junit4/wiki/parameterized-tests

JUnitParams

https://github.com/Pragmatists/JUnitParams

GrantPermissionRule

Before: helper

Before: Run

After: Run with GrantPermissionRule

Android Test Orchestrator

Enable from Gradle

https://developer.android.com/training/testing/junit-runner.html#accessing-instrumentation-info

Tips

Tips1

• Assertj and Truth

Tips1

• Instrumented tests failure with AndroidJUnitRunner 1.0.0 and AssertJ• https://stackoverflow.com/questions/45402645/instrumented-tests-failure-with-androidjunitrunner-1-0-0-and-assertj

Tips1

• Truth• https://github.com/google/truth• http://google.github.io/truth/

Tips2• Can’t keep the order for test cases with Annotation Type FixMethodOrder• Run with the Android Test Orchestrator

http://junit.org/junit4/javadoc/4.12/org/junit/FixMethodOrder.html

@Kazu_cocoa