Skip to content
Closed

hi #129

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1e15ffc
Merge pull request #72 from googlesamples/JoseAlcerreca-atsl-readme-1
slinzner Dec 15, 2015
815eded
Fix some weird typos in README
JoseAlcerreca Dec 15, 2015
7945ce6
-Fixed url overloading for espresso web sample
JoseAlcerreca Dec 18, 2015
ab04020
Update CONTRIBUTING.md
JoseAlcerreca Dec 18, 2015
cd2a0d4
Added support to the Marshmallow new permission model
saulmm Jan 2, 2016
0e985b9
Bumps gradle and plugin versions (2.10, 2.0.0-alpha6)
JoseAlcerreca Jan 22, 2016
59fa3ad
Merge pull request #78 from saulmm/master
JoseAlcerreca Feb 4, 2016
59268b8
Upgrade all gradle version from alpha6 to beta2
zxx714 Feb 10, 2016
61fa82e
Merge pull request #81 from zxx714/master
JoseAlcerreca Feb 18, 2016
e1e02ed
Removes Espresso cheat sheet from downloads (see the ATSL docs page)
JoseAlcerreca Feb 19, 2016
a90b018
Updates Gradle plugin to 2.1.0-alpha3
JoseAlcerreca Mar 21, 2016
e7b403c
Bumps gradle plugin version to 2.1.0
JoseAlcerreca May 18, 2016
5eb4693
Update versions and temporarily disable IntentsBasicSample test
JoseAlcerreca Aug 1, 2016
ed62c45
Fixes permissions issue in IntentsBasicSample
JoseAlcerreca Aug 3, 2016
55ebb61
Fixed {@code} javadoc tag
vinaywadhwa Aug 12, 2016
5dfd5a8
Merge pull request #102 from vinaywadhwa/master
JoseAlcerreca Aug 12, 2016
9c375f0
removed unused javadoc @param tag
vinaywadhwa Aug 12, 2016
fc95d63
removed unused imports
vinaywadhwa Aug 12, 2016
22100ea
Merge pull request #104 from vinaywadhwa/cleanup
JoseAlcerreca Aug 16, 2016
e34c147
Adds 2 new samples (Idling Resources and RecyclerViews for Espresso) …
JoseAlcerreca Aug 26, 2016
e992f10
fixing extra space
JoseAlcerreca Aug 26, 2016
8f94016
Updating <size>Test annotations to be from
Dec 21, 2016
adb986a
Merge pull request #125 from DougSig/new_annotations
slinzner Jan 9, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ 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()`

**[IntentsAdvancedSample](https://github.com/googlesamples/android-testing/blob/master/ui/espresso/IntentsAdvancedSample)** - Simulates a user fetching a bitmap using the camera

**[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
Expand Down
Binary file removed downloads/Espresso Cheat Sheet Master.pdf
Binary file not shown.
Binary file removed downloads/Espresso Cheat Sheet Master.png
Binary file not shown.
Binary file removed downloads/espresso-cheat-sheet-2.1.0.pdf
Binary file not shown.
Binary file removed downloads/espresso-cheat-sheet-2.1.0.png
Binary file not shown.
15 changes: 6 additions & 9 deletions integration/ServiceTestRuleSample/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
Expand Down
9 changes: 8 additions & 1 deletion integration/ServiceTestRuleSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,3 +17,10 @@ allprojects {
jcenter()
}
}

ext {
buildToolsVersion = "24.0.1"
supportLibVersion = "24.2.0"
runnerVersion = "0.5"
rulesVersion = "0.5"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 8 additions & 11 deletions runner/AndroidJunitRunnerSample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 9 additions & 1 deletion runner/AndroidJunitRunnerSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 8 additions & 11 deletions ui/espresso/BasicSample/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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
}
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 9 additions & 1 deletion ui/espresso/BasicSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 8 additions & 11 deletions ui/espresso/CustomMatcherSample/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -18,9 +18,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
lintOptions {
abortOnError false
}
Expand All @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading