diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b86f95d7..f282da6a4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,23 @@ # How to become a contributor and submit your own code +To contribute with a small fix, simply create a pull request. If you want to add a new sample or plan to request a big change, [contact us](https://groups.google.com/forum/#!forum/android-testing-support-library) first. + +## Contributing new samples + +If you want to contribute full samples, we'd love to review and accept them. In case you need ideas, these are some samples on the roadmap: + +* Advanced Idling Resource +* RecyclerView actions +* Sharding +* RunListener +* Rules + +You can also contribute to this list if you have a sample request. + +## Code style and structure + +Please check out the [Code Style for Contributors](https://source.android.com/source/code-style.html) section in AOSP. Also, check out the rest of the samples and maintain as much consistency with them as possible. + ## Contributor License Agreements We'd love to accept your sample apps and patches! Before we can take them, we diff --git a/README.md b/README.md index 7e5bce347..2edc6684d 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,11 @@ A collection of samples demonstrating different frameworks and techniques for au **[BasicSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/BasicSample)** - Basic Espresso sample -**[CustomMatcherSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/CustomMatcherSample)** - Shows how to extend Espresso to match the *hint* property of n EditText +**[CustomMatcherSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/CustomMatcherSample)** - Shows how to extend Espresso to match the *hint* property of an EditText -**[DataAdapterSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/DataAdapterSample)** - Showcases the `onData()` entry point for Espresso, for lists and dapterViews +**[DataAdapterSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/DataAdapterSample)** - Showcases the `onData()` entry point for Espresso, for lists and AdapterViews + +**[IdlingResourceSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/IdlingResourceSample)** - Synchronization with background jobs **[IntentsBasicSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/IntentsBasicSample)** - Basic usage of `intended()` and `intending()` @@ -17,7 +19,9 @@ A collection of samples demonstrating different frameworks and techniques for au **[MultiWindowSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/MultiWindowSample)** - Shows how to point Espresso to different windows -**[WebBasicSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/WebBasicSample)** - Use Espresso-web to interact with WebViews. +**[RecyclerViewSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/RecyclerViewSample)** - RecyclerView actions for Espresso + +**[WebBasicSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/WebBasicSample)** - Use Espresso-web to interact with WebViews **[BasicSampleBundled](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/BasicSampleBundled)** - Basic sample for Eclipse and other IDEs ### UiAutomator Sample diff --git a/downloads/Espresso Cheat Sheet Master.pdf b/downloads/Espresso Cheat Sheet Master.pdf deleted file mode 100644 index de3c2074a..000000000 Binary files a/downloads/Espresso Cheat Sheet Master.pdf and /dev/null differ diff --git a/downloads/Espresso Cheat Sheet Master.png b/downloads/Espresso Cheat Sheet Master.png deleted file mode 100644 index f53b5c0e7..000000000 Binary files a/downloads/Espresso Cheat Sheet Master.png and /dev/null differ diff --git a/downloads/espresso-cheat-sheet-2.1.0.pdf b/downloads/espresso-cheat-sheet-2.1.0.pdf deleted file mode 100644 index de3c2074a..000000000 Binary files a/downloads/espresso-cheat-sheet-2.1.0.pdf and /dev/null differ diff --git a/downloads/espresso-cheat-sheet-2.1.0.png b/downloads/espresso-cheat-sheet-2.1.0.png deleted file mode 100644 index f53b5c0e7..000000000 Binary files a/downloads/espresso-cheat-sheet-2.1.0.png and /dev/null differ diff --git a/integration/ServiceTestRuleSample/app/build.gradle b/integration/ServiceTestRuleSample/app/build.gradle index 67176693b..b04463c42 100644 --- a/integration/ServiceTestRuleSample/app/build.gradle +++ b/integration/ServiceTestRuleSample/app/build.gradle @@ -1,20 +1,17 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '23.0.1' + compileSdkVersion 24 + buildToolsVersion rootProject.buildToolsVersion defaultConfig { applicationId "com.example.android.testing.integrationtesting.ServiceTestRuleSample" minSdkVersion 10 - targetSdkVersion 23 + targetSdkVersion 24 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } - packagingOptions { - exclude 'LICENSE.txt' - } lintOptions { abortOnError false } @@ -25,7 +22,7 @@ android { dependencies { // Testing-only dependencies // Force usage of support annotations in the test app, since it is internally used by the runner module. - androidTestCompile 'com.android.support:support-annotations:23.0.1' - androidTestCompile 'com.android.support.test:runner:0.4.1' - androidTestCompile 'com.android.support.test:rules:0.4.1' + androidTestCompile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; + androidTestCompile 'com.android.support.test:runner:' + rootProject.runnerVersion; + androidTestCompile 'com.android.support.test:rules:' + rootProject.rulesVersion; } diff --git a/integration/ServiceTestRuleSample/app/src/androidTest/java/com.example.android.testing.ServiceTestRuleSample/LocalServiceTest.java b/integration/ServiceTestRuleSample/app/src/androidTest/java/com/example/android/testing/ServiceTestRuleSample/LocalServiceTest.java similarity index 94% rename from integration/ServiceTestRuleSample/app/src/androidTest/java/com.example.android.testing.ServiceTestRuleSample/LocalServiceTest.java rename to integration/ServiceTestRuleSample/app/src/androidTest/java/com/example/android/testing/ServiceTestRuleSample/LocalServiceTest.java index 6009201d3..fdef6cf2b 100644 --- a/integration/ServiceTestRuleSample/app/src/androidTest/java/com.example.android.testing.ServiceTestRuleSample/LocalServiceTest.java +++ b/integration/ServiceTestRuleSample/app/src/androidTest/java/com/example/android/testing/ServiceTestRuleSample/LocalServiceTest.java @@ -19,10 +19,13 @@ import android.content.Intent; import android.os.IBinder; import android.support.test.InstrumentationRegistry; +import android.support.test.filters.MediumTest; import android.support.test.rule.ServiceTestRule; +import android.support.test.runner.AndroidJUnit4; import org.junit.Rule; import org.junit.Test; +import org.junit.runner.RunWith; import java.util.concurrent.TimeoutException; @@ -47,6 +50,8 @@ * all outstanding commands. So there is no guarantee to establish a successful connection * in a timely manner. */ +@MediumTest +@RunWith(AndroidJUnit4.class) public class LocalServiceTest { @Rule public final ServiceTestRule mServiceRule = new ServiceTestRule(); diff --git a/integration/ServiceTestRuleSample/build.gradle b/integration/ServiceTestRuleSample/build.gradle index c6371d6cd..73f4f75d0 100644 --- a/integration/ServiceTestRuleSample/build.gradle +++ b/integration/ServiceTestRuleSample/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:2.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -17,3 +17,10 @@ allprojects { jcenter() } } + +ext { + buildToolsVersion = "24.0.1" + supportLibVersion = "24.2.0" + runnerVersion = "0.5" + rulesVersion = "0.5" +} diff --git a/integration/ServiceTestRuleSample/gradle/wrapper/gradle-wrapper.properties b/integration/ServiceTestRuleSample/gradle/wrapper/gradle-wrapper.properties index 0ed71dbdb..816bee033 100644 --- a/integration/ServiceTestRuleSample/gradle/wrapper/gradle-wrapper.properties +++ b/integration/ServiceTestRuleSample/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/runner/AndroidJunitRunnerSample/app/build.gradle b/runner/AndroidJunitRunnerSample/app/build.gradle index 85cd00100..6a30def79 100644 --- a/runner/AndroidJunitRunnerSample/app/build.gradle +++ b/runner/AndroidJunitRunnerSample/app/build.gradle @@ -2,20 +2,17 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '23.0.1' + compileSdkVersion 24 + buildToolsVersion rootProject.buildToolsVersion defaultConfig { applicationId "com.example.android.testing.androidjunitrunnersample" minSdkVersion 8 - targetSdkVersion 23 + targetSdkVersion 24 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } - packagingOptions { - exclude 'LICENSE.txt' - } buildTypes { release { minifyEnabled false @@ -28,13 +25,13 @@ android { dependencies { // App's dependencies, including test - compile 'com.android.support:support-annotations:23.0.1' + compile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; compile 'com.google.guava:guava:18.0' // Testing-only dependencies // Force usage of support annotations in the test app, since it is internally used by the runner module. - androidTestCompile 'com.android.support:support-annotations:23.0.1' - androidTestCompile 'com.android.support.test:runner:0.4.1' - androidTestCompile 'com.android.support.test:rules:0.4.1' - androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' + androidTestCompile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; + androidTestCompile 'com.android.support.test:runner:' + rootProject.runnerVersion; + androidTestCompile 'com.android.support.test:rules:' + rootProject.rulesVersion; + androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion; } diff --git a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorAddParameterizedTest.java b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorAddParameterizedTest.java index 65d0f034c..6180016bc 100644 --- a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorAddParameterizedTest.java +++ b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorAddParameterizedTest.java @@ -21,7 +21,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import android.test.suitebuilder.annotation.SmallTest; +import android.support.test.filters.SmallTest; import java.lang.Iterable; import java.util.Arrays; diff --git a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorInstrumentationTest.java b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorInstrumentationTest.java index 369fb1602..2105fc125 100644 --- a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorInstrumentationTest.java +++ b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorInstrumentationTest.java @@ -24,11 +24,11 @@ import org.junit.internal.builders.AllDefaultPossibilitiesBuilder; import org.junit.runner.RunWith; +import android.support.test.filters.LargeTest; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.support.test.runner.AndroidJUnitRunner; import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; diff --git a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorTest.java b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorTest.java index 8c6eff5b7..430fc9b79 100644 --- a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorTest.java +++ b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorTest.java @@ -20,8 +20,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import android.support.test.filters.SmallTest; import android.support.test.runner.AndroidJUnit4; -import android.test.suitebuilder.annotation.SmallTest; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; diff --git a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintInstrumentationTest.java b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintInstrumentationTest.java index ee2753057..8f01266ff 100644 --- a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintInstrumentationTest.java +++ b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintInstrumentationTest.java @@ -18,12 +18,11 @@ import junit.framework.TestSuite; -import org.junit.Test; import org.junit.internal.builders.AllDefaultPossibilitiesBuilder; +import android.support.test.filters.LargeTest; import android.support.test.runner.AndroidJUnitRunner; import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; import static com.example.android.testing.androidjunitrunnersample.HintMatcher.withHint; import static android.support.test.espresso.Espresso.onView; diff --git a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintLegacyInstrumentationTest.java b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintLegacyInstrumentationTest.java index 6015fb69f..4ae1e1877 100644 --- a/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintLegacyInstrumentationTest.java +++ b/runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintLegacyInstrumentationTest.java @@ -20,9 +20,9 @@ import org.junit.internal.builders.AllDefaultPossibilitiesBuilder; +import android.support.test.filters.LargeTest; import android.support.test.runner.AndroidJUnitRunner; import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.assertion.ViewAssertions.matches; diff --git a/runner/AndroidJunitRunnerSample/build.gradle b/runner/AndroidJunitRunnerSample/build.gradle index c6371d6cd..4efae5aa5 100644 --- a/runner/AndroidJunitRunnerSample/build.gradle +++ b/runner/AndroidJunitRunnerSample/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:2.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -17,3 +17,11 @@ allprojects { jcenter() } } + +ext { + buildToolsVersion = "24.0.1" + supportLibVersion = "24.2.0" + runnerVersion = "0.5" + rulesVersion = "0.5" + espressoVersion = "2.2.2" +} diff --git a/runner/AndroidJunitRunnerSample/gradle/wrapper/gradle-wrapper.properties b/runner/AndroidJunitRunnerSample/gradle/wrapper/gradle-wrapper.properties index 888431a3b..0b681736c 100644 --- a/runner/AndroidJunitRunnerSample/gradle/wrapper/gradle-wrapper.properties +++ b/runner/AndroidJunitRunnerSample/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/ui/espresso/BasicSample/app/build.gradle b/ui/espresso/BasicSample/app/build.gradle index 5e84e3dc2..8fbc7c88e 100644 --- a/ui/espresso/BasicSample/app/build.gradle +++ b/ui/espresso/BasicSample/app/build.gradle @@ -1,20 +1,17 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '23.0.1' + compileSdkVersion 24 + buildToolsVersion rootProject.buildToolsVersion defaultConfig { applicationId "com.example.android.testing.espresso.BasicSample" minSdkVersion 10 - targetSdkVersion 23 + targetSdkVersion 24 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } - packagingOptions { - exclude 'LICENSE.txt' - } lintOptions { abortOnError false } @@ -24,12 +21,12 @@ android { dependencies { // App dependencies - compile 'com.android.support:support-annotations:23.0.1' + compile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; compile 'com.google.guava:guava:18.0' // Testing-only dependencies // Force usage of support annotations in the test app, since it is internally used by the runner module. - androidTestCompile 'com.android.support:support-annotations:23.0.1' - androidTestCompile 'com.android.support.test:runner:0.4.1' - androidTestCompile 'com.android.support.test:rules:0.4.1' - androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' + androidTestCompile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; + androidTestCompile 'com.android.support.test:runner:' + rootProject.runnerVersion; + androidTestCompile 'com.android.support.test:rules:' + rootProject.rulesVersion; + androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion; } diff --git a/ui/espresso/BasicSample/app/src/androidTest/java/com/example/android/testing/espresso/BasicSample/ChangeTextBehaviorTest.java b/ui/espresso/BasicSample/app/src/androidTest/java/com/example/android/testing/espresso/BasicSample/ChangeTextBehaviorTest.java index 9c0ed396d..1fb7e1bb2 100644 --- a/ui/espresso/BasicSample/app/src/androidTest/java/com/example/android/testing/espresso/BasicSample/ChangeTextBehaviorTest.java +++ b/ui/espresso/BasicSample/app/src/androidTest/java/com/example/android/testing/espresso/BasicSample/ChangeTextBehaviorTest.java @@ -26,8 +26,8 @@ import android.support.test.espresso.matcher.ViewMatchers; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; +import android.support.test.filters.LargeTest; import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; diff --git a/ui/espresso/BasicSample/build.gradle b/ui/espresso/BasicSample/build.gradle index c6371d6cd..1b2a09179 100644 --- a/ui/espresso/BasicSample/build.gradle +++ b/ui/espresso/BasicSample/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:2.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -17,3 +17,11 @@ allprojects { jcenter() } } + +ext { + buildToolsVersion = "24.0.1" + supportLibVersion = "24.2.0" + runnerVersion = "0.5" + rulesVersion = "0.5" + espressoVersion = "2.2.2" +} diff --git a/ui/espresso/BasicSample/gradle/wrapper/gradle-wrapper.properties b/ui/espresso/BasicSample/gradle/wrapper/gradle-wrapper.properties index 0ed71dbdb..816bee033 100644 --- a/ui/espresso/BasicSample/gradle/wrapper/gradle-wrapper.properties +++ b/ui/espresso/BasicSample/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/ui/espresso/CustomMatcherSample/app/build.gradle b/ui/espresso/CustomMatcherSample/app/build.gradle index 9794b9079..11e71ca0a 100644 --- a/ui/espresso/CustomMatcherSample/app/build.gradle +++ b/ui/espresso/CustomMatcherSample/app/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '23.0.1' + compileSdkVersion 24 + buildToolsVersion rootProject.buildToolsVersion defaultConfig { applicationId "com.example.android.testing.espresso.CustomMatcherSample" minSdkVersion 10 - targetSdkVersion 23 + targetSdkVersion 24 versionCode 1 versionName "1.0" @@ -18,9 +18,6 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } - packagingOptions { - exclude 'LICENSE.txt' - } lintOptions { abortOnError false } @@ -30,12 +27,12 @@ android { dependencies { // App dependencies - compile 'com.android.support:support-annotations:23.0.1' + compile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; compile 'com.google.guava:guava:18.0' // Testing-only dependencies // Force usage of support annotations in the test app, since it is internally used by the runner module. - androidTestCompile 'com.android.support:support-annotations:23.0.1' - androidTestCompile 'com.android.support.test:runner:0.4.1' - androidTestCompile 'com.android.support.test:rules:0.4.1' - androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' + androidTestCompile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; + androidTestCompile 'com.android.support.test:runner:' + rootProject.runnerVersion; + androidTestCompile 'com.android.support.test:rules:' + rootProject.rulesVersion; + androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion; } diff --git a/ui/espresso/CustomMatcherSample/app/src/androidTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java b/ui/espresso/CustomMatcherSample/app/src/androidTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java index a0a0f9d47..d0ee35887 100644 --- a/ui/espresso/CustomMatcherSample/app/src/androidTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java +++ b/ui/espresso/CustomMatcherSample/app/src/androidTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java @@ -21,10 +21,10 @@ import org.junit.Test; import org.junit.runner.RunWith; +import android.support.test.filters.LargeTest; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; diff --git a/ui/espresso/CustomMatcherSample/build.gradle b/ui/espresso/CustomMatcherSample/build.gradle index c6371d6cd..4efae5aa5 100644 --- a/ui/espresso/CustomMatcherSample/build.gradle +++ b/ui/espresso/CustomMatcherSample/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:2.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -17,3 +17,11 @@ allprojects { jcenter() } } + +ext { + buildToolsVersion = "24.0.1" + supportLibVersion = "24.2.0" + runnerVersion = "0.5" + rulesVersion = "0.5" + espressoVersion = "2.2.2" +} diff --git a/ui/espresso/CustomMatcherSample/gradle/wrapper/gradle-wrapper.properties b/ui/espresso/CustomMatcherSample/gradle/wrapper/gradle-wrapper.properties index 0c71e760d..d57051703 100644 --- a/ui/espresso/CustomMatcherSample/gradle/wrapper/gradle-wrapper.properties +++ b/ui/espresso/CustomMatcherSample/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/ui/espresso/DataAdapterSample/app/build.gradle b/ui/espresso/DataAdapterSample/app/build.gradle index 3ca6b0bda..ee692a4f2 100644 --- a/ui/espresso/DataAdapterSample/app/build.gradle +++ b/ui/espresso/DataAdapterSample/app/build.gradle @@ -1,32 +1,29 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion '23.0.1' + compileSdkVersion 24 + buildToolsVersion rootProject.buildToolsVersion defaultConfig { applicationId "com.example.android.testing.espresso.DataAdapterSample" minSdkVersion 10 - targetSdkVersion 23 + targetSdkVersion 24 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } - packagingOptions { - exclude 'LICENSE.txt' - } productFlavors { } } dependencies { // App dependencies - compile 'com.android.support:support-annotations:23.0.1' + compile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; compile 'com.google.guava:guava:18.0' // Testing-only dependencies // Force usage of support annotations in the test app, since it is internally used by the runner module. - androidTestCompile 'com.android.support:support-annotations:23.0.1' - androidTestCompile 'com.android.support.test:runner:0.4.1' - androidTestCompile 'com.android.support.test:rules:0.4.1' - androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' + androidTestCompile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; + androidTestCompile 'com.android.support.test:runner:' + rootProject.runnerVersion; + androidTestCompile 'com.android.support.test:rules:' + rootProject.rulesVersion; + androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion; } diff --git a/ui/espresso/DataAdapterSample/app/src/androidTest/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivityTest.java b/ui/espresso/DataAdapterSample/app/src/androidTest/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivityTest.java index 2589e3209..45a3249ce 100644 --- a/ui/espresso/DataAdapterSample/app/src/androidTest/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivityTest.java +++ b/ui/espresso/DataAdapterSample/app/src/androidTest/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivityTest.java @@ -25,12 +25,10 @@ import android.support.test.espresso.Espresso; import android.support.test.espresso.action.ViewActions; import android.support.test.espresso.matcher.ViewMatchers; +import android.support.test.filters.LargeTest; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -import java.util.Map; import static android.support.test.espresso.Espresso.onData; import static android.support.test.espresso.Espresso.onView; @@ -41,10 +39,8 @@ import static android.support.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasEntry; -import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.is; /** diff --git a/ui/espresso/DataAdapterSample/build.gradle b/ui/espresso/DataAdapterSample/build.gradle index c6371d6cd..4efae5aa5 100644 --- a/ui/espresso/DataAdapterSample/build.gradle +++ b/ui/espresso/DataAdapterSample/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:2.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -17,3 +17,11 @@ allprojects { jcenter() } } + +ext { + buildToolsVersion = "24.0.1" + supportLibVersion = "24.2.0" + runnerVersion = "0.5" + rulesVersion = "0.5" + espressoVersion = "2.2.2" +} diff --git a/ui/espresso/DataAdapterSample/gradle/wrapper/gradle-wrapper.properties b/ui/espresso/DataAdapterSample/gradle/wrapper/gradle-wrapper.properties index ed7059864..29546a7b4 100644 --- a/ui/espresso/DataAdapterSample/gradle/wrapper/gradle-wrapper.properties +++ b/ui/espresso/DataAdapterSample/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/ui/espresso/IdlingResourceSample/.gitignore b/ui/espresso/IdlingResourceSample/.gitignore new file mode 100644 index 000000000..1406630a7 --- /dev/null +++ b/ui/espresso/IdlingResourceSample/.gitignore @@ -0,0 +1,6 @@ +.gradle +local.properties +.idea +.DS_Store +build +*.iml diff --git a/ui/espresso/IdlingResourceSample/README.md b/ui/espresso/IdlingResourceSample/README.md new file mode 100644 index 000000000..4ff8f598d --- /dev/null +++ b/ui/espresso/IdlingResourceSample/README.md @@ -0,0 +1,24 @@ +# Basic Idling Resource sample for Espresso + +The centerpiece of Espresso is its ability to seamlessly synchronize all test operations with the application under test. By default, Espresso waits for UI events in the current message queue to be processed and default AsyncTasks* to complete before it moves on to the next test operation. This should address the majority of application/test synchronization in your application. + +However, there are instances where applications perform background operations (such as communicating with web services) via non-standard means; for example: direct creation and management of threads. + +This sample showcases how to implement a very simple IdlingResource interface and expose it to a test. The application shows a message to the user after a delay that is executed on a different thread. + +Consider using the CountingIdlingResource class from the espresso-contrib package. It's a very easy to use Idling Resource implementation that can handle multiple parallel operations keeping track of the number of pending operations. + +Note that the `espresso-idling-resource` dependency is added into the `compile` scope: + +``` + androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' + compile 'com.android.support.test.espresso:espresso-idling-resource:2.2.2' +``` + +This dependency and its implementation are added to the app under test but are not needed in production. This bloats the released app but it's kept this way to simplify the sample. You can: + * ProGuard/shrink your release build to minimize impact + * Use a build type or product flavor for tests and remove the Idling Resource classes in the production/release variant. + * Add the dependency to `androidTestCompile` and inject an IdlingResource-aware MessageDelayer from the test. + * Keep them, since the added methods and size are insignificant. + + diff --git a/ui/espresso/IdlingResourceSample/app/build.gradle b/ui/espresso/IdlingResourceSample/app/build.gradle new file mode 100644 index 000000000..f5dced658 --- /dev/null +++ b/ui/espresso/IdlingResourceSample/app/build.gradle @@ -0,0 +1,52 @@ +/* + * Copyright 2016, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'com.android.application' + +android { + compileSdkVersion 24 + buildToolsVersion rootProject.buildToolsVersion + + defaultConfig { + applicationId "com.example.android.testing.espresso.IdlingResourceSample" + minSdkVersion 10 + targetSdkVersion 24 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + lintOptions { + abortOnError false + } +} + +dependencies { + // App dependencies + compile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; + compile 'com.google.guava:guava:18.0' + + // Testing-only dependencies + androidTestCompile 'com.android.support.test:runner:' + rootProject.runnerVersion + androidTestCompile 'com.android.support.test:rules:' + rootProject.rulesVersion; + androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion; + // Note that espresso-idling-resource is used in the code under test. + compile 'com.android.support.test.espresso:espresso-idling-resource:' + rootProject.espressoVersion; + + // Force usage of support annotations in the test app, since it is internally used by the + // runner module. + androidTestCompile 'com.android.support:support-annotations:' + rootProject.supportLibVersion; +} diff --git a/ui/espresso/IdlingResourceSample/app/src/androidTest/java/com/example/android/testing/espresso/IdlingResourceSample/ChangeTextBehaviorTest.java b/ui/espresso/IdlingResourceSample/app/src/androidTest/java/com/example/android/testing/espresso/IdlingResourceSample/ChangeTextBehaviorTest.java new file mode 100644 index 000000000..c920bc4f7 --- /dev/null +++ b/ui/espresso/IdlingResourceSample/app/src/androidTest/java/com/example/android/testing/espresso/IdlingResourceSample/ChangeTextBehaviorTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2016, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.android.testing.espresso.IdlingResourceSample; + +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; +import static android.support.test.espresso.action.ViewActions.typeText; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; + +import android.support.test.espresso.Espresso; +import android.support.test.espresso.IdlingResource; +import android.support.test.filters.LargeTest; +import android.support.test.rule.ActivityTestRule; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + + +/** + * Same as Espresso's BasicSample, but with an Idling Resource to help with synchronization. + */ +@RunWith(AndroidJUnit4.class) +@LargeTest +public class ChangeTextBehaviorTest { + + private static final String STRING_TO_BE_TYPED = "Espresso"; + + @Rule + public ActivityTestRule mActivityRule = new ActivityTestRule<>( + MainActivity.class); + + private IdlingResource mIdlingResource; + + @Before + public void registerIdlingResource() { + mIdlingResource = mActivityRule.getActivity().getIdlingResource(); + // To prove that the test fails, omit this call: + Espresso.registerIdlingResources(mIdlingResource); + } + + @Test + public void changeText_sameActivity() { + // Type text and then press the button. + onView(withId(R.id.editTextUserInput)) + .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard()); + onView(withId(R.id.changeTextBt)).perform(click()); + + // Check that the text was changed. + onView(withId(R.id.textToBeChanged)).check(matches(withText(STRING_TO_BE_TYPED))); + } + + @After + public void unregisterIdlingResource() { + if (mIdlingResource != null) { + Espresso.unregisterIdlingResources(mIdlingResource); + } + } +} \ No newline at end of file diff --git a/ui/espresso/IdlingResourceSample/app/src/main/AndroidManifest.xml b/ui/espresso/IdlingResourceSample/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..d65821e06 --- /dev/null +++ b/ui/espresso/IdlingResourceSample/app/src/main/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/IdlingResource/SimpleIdlingResource.java b/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/IdlingResource/SimpleIdlingResource.java new file mode 100644 index 000000000..b4d2fc4a9 --- /dev/null +++ b/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/IdlingResource/SimpleIdlingResource.java @@ -0,0 +1,63 @@ +/* + * Copyright 2016, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.android.testing.espresso.IdlingResourceSample.IdlingResource; + +import android.support.annotation.Nullable; +import android.support.test.espresso.IdlingResource; + +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * A very simple implementation of {@link IdlingResource}. + *

+ * Consider using CountingIdlingResource from espresso-contrib package if you use this class from + * multiple threads or need to keep a count of pending operations. + */ + +public class SimpleIdlingResource implements IdlingResource { + + @Nullable private volatile ResourceCallback mCallback; + + // Idleness is controlled with this boolean. + private AtomicBoolean mIsIdleNow = new AtomicBoolean(true); + + @Override + public String getName() { + return this.getClass().getName(); + } + + @Override + public boolean isIdleNow() { + return mIsIdleNow.get(); + } + + @Override + public void registerIdleTransitionCallback(ResourceCallback callback) { + mCallback = callback; + } + + /** + * Sets the new idle state, if isIdleNow is true, it pings the {@link ResourceCallback}. + * @param isIdleNow false if there are pending operations, true if idle. + */ + public void setIdleState(boolean isIdleNow) { + mIsIdleNow.set(isIdleNow); + if (isIdleNow && mCallback != null) { + mCallback.onTransitionToIdle(); + } + } +} diff --git a/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MainActivity.java b/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MainActivity.java new file mode 100644 index 000000000..560ce7d10 --- /dev/null +++ b/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MainActivity.java @@ -0,0 +1,88 @@ +/* + * Copyright 2016, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.android.testing.espresso.IdlingResourceSample; + +import android.app.Activity; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.annotation.VisibleForTesting; +import android.support.test.espresso.IdlingResource; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; + +import com.example.android.testing.espresso.IdlingResourceSample.IdlingResource.SimpleIdlingResource; + +/** + * Gets a text String from the user and displays it back after a while. + */ +public class MainActivity extends Activity implements View.OnClickListener, + MessageDelayer.DelayerCallback { + + // The TextView used to display the message inside the Activity. + private TextView mTextView; + + // The EditText where the user types the message. + private EditText mEditText; + + // The Idling Resource which will be null in production. + @Nullable private SimpleIdlingResource mIdlingResource; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + // Set the listeners for the buttons. + findViewById(R.id.changeTextBt).setOnClickListener(this); + + mTextView = (TextView) findViewById(R.id.textToBeChanged); + mEditText = (EditText) findViewById(R.id.editTextUserInput); + } + + @Override + public void onClick(View view) { + // Get the text from the EditText view. + final String text = mEditText.getText().toString(); + + if (view.getId() == R.id.changeTextBt) { + // Set a temporary text. + mTextView.setText(R.string.waiting_msg); + // Submit the message to the delayer. + MessageDelayer.processMessage(text, this, mIdlingResource); + } + } + + @Override + public void onDone(String text) { + // The delayer notifies the activity via a callback. + mTextView.setText(text); + } + + /** + * Only called from test, creates and returns a new {@link SimpleIdlingResource}. + */ + @VisibleForTesting + @NonNull + public IdlingResource getIdlingResource() { + if (mIdlingResource == null) { + mIdlingResource = new SimpleIdlingResource(); + } + return mIdlingResource; + } +} diff --git a/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MessageDelayer.java b/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MessageDelayer.java new file mode 100644 index 000000000..54278a66e --- /dev/null +++ b/ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MessageDelayer.java @@ -0,0 +1,65 @@ +/* + * Copyright 2016, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.android.testing.espresso.IdlingResourceSample; + +import android.os.Handler; +import android.support.annotation.Nullable; +import android.support.test.espresso.IdlingResource; + +import com.example.android.testing.espresso.IdlingResourceSample.IdlingResource.SimpleIdlingResource; + +/** + * Takes a String and returns it after a while via a callback. + *

+ * This executes a long-running operation on a different thread that results in problems with + * Espresso if an {@link IdlingResource} is not implemented and registered. + */ +class MessageDelayer { + + private static final int DELAY_MILLIS = 3000; + + interface DelayerCallback { + void onDone(String text); + } + + /** + * Takes a String and returns it after {@link #DELAY_MILLIS} via a {@link DelayerCallback}. + * @param message the String that will be returned via the callback + * @param callback used to notify the caller asynchronously + */ + static void processMessage(final String message, final DelayerCallback callback, + @Nullable final SimpleIdlingResource idlingResource) { + // The IdlingResource is null in production. + if (idlingResource != null) { + idlingResource.setIdleState(false); + } + + // Delay the execution, return message via callback. + Handler handler = new Handler(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + if (callback != null) { + callback.onDone(message); + if (idlingResource != null) { + idlingResource.setIdleState(true); + } + } + } + }, DELAY_MILLIS); + } +} diff --git a/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-hdpi/ic_launcher.png b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 000000000..6b0f252c4 Binary files /dev/null and b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-mdpi/ic_launcher.png b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 000000000..b2fe59cc2 Binary files /dev/null and b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 000000000..0edc166fe Binary files /dev/null and b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..252724020 Binary files /dev/null and b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xxxhdpi/ic_launcher.png b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..0e23e29d8 Binary files /dev/null and b/ui/espresso/IdlingResourceSample/app/src/main/res/drawable-xxxhdpi/ic_launcher.png differ diff --git a/ui/espresso/IdlingResourceSample/app/src/main/res/layout/activity_main.xml b/ui/espresso/IdlingResourceSample/app/src/main/res/layout/activity_main.xml new file mode 100644 index 000000000..41f67e320 --- /dev/null +++ b/ui/espresso/IdlingResourceSample/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,52 @@ + + + + + + + + + + +