├── MyApplication ├── settings.gradle ├── app │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── habrahabr │ │ │ │ │ └── ru │ │ │ │ │ └── myapplication │ │ │ │ │ ├── LoginTask.java │ │ │ │ │ ├── SecretActivity.java │ │ │ │ │ └── MainActivity.java │ │ │ ├── res │ │ │ │ ├── drawable-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-v21 │ │ │ │ │ └── styles.xml │ │ │ │ ├── values │ │ │ │ │ ├── styles.xml │ │ │ │ │ ├── dimens.xml │ │ │ │ │ └── strings.xml │ │ │ │ ├── menu │ │ │ │ │ ├── menu_main.xml │ │ │ │ │ └── menu_secret.xml │ │ │ │ ├── values-w820dp │ │ │ │ │ └── dimens.xml │ │ │ │ └── layout │ │ │ │ │ ├── activity_secret.xml │ │ │ │ │ └── activity_main.xml │ │ │ └── AndroidManifest.xml │ │ └── androidTest │ │ │ ├── java │ │ │ └── habrahabr │ │ │ │ └── ru │ │ │ │ └── myapplication │ │ │ │ └── test │ │ │ │ ├── ApplicationTest.java │ │ │ │ ├── CucuRunner.java │ │ │ │ └── CucumberActivitySteps.java │ │ │ └── assets │ │ │ └── features │ │ │ └── Test.feature │ └── build.gradle ├── cucumber_reports │ ├── embedded0.png │ ├── embedded1.png │ ├── embedded2.png │ ├── embedded3.png │ ├── index.html │ ├── style.css │ ├── formatter.js │ ├── report.js │ └── jquery-1.8.2.min.js ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build │ └── intermediates │ │ ├── model_data.bin │ │ ├── lint-cache │ │ ├── typos-en.txt-2.bin │ │ └── api-versions-6-21.bin │ │ └── dex-cache │ │ └── cache.xml ├── build.gradle ├── .idea │ └── gradle.xml ├── .gitignore ├── gradle.properties ├── gradlew.bat └── gradlew ├── README.md └── LICENSE /MyApplication/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/habrahabr/ru/myapplication/LoginTask.java: -------------------------------------------------------------------------------- 1 | package habrahabr.ru.myapplication; 2 | 3 | 4 | -------------------------------------------------------------------------------- /MyApplication/cucumber_reports/embedded0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/cucumber_reports/embedded0.png -------------------------------------------------------------------------------- /MyApplication/cucumber_reports/embedded1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/cucumber_reports/embedded1.png -------------------------------------------------------------------------------- /MyApplication/cucumber_reports/embedded2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/cucumber_reports/embedded2.png -------------------------------------------------------------------------------- /MyApplication/cucumber_reports/embedded3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/cucumber_reports/embedded3.png -------------------------------------------------------------------------------- /MyApplication/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /MyApplication/build/intermediates/model_data.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/build/intermediates/model_data.bin -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MyApplication/build/intermediates/lint-cache/typos-en.txt-2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/build/intermediates/lint-cache/typos-en.txt-2.bin -------------------------------------------------------------------------------- /MyApplication/build/intermediates/lint-cache/api-versions-6-21.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stabilitron/espresso-cucumber-example/HEAD/MyApplication/build/intermediates/lint-cache/api-versions-6-21.bin -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # espresso-cucumber-example 2 | Example for using of Espresso (https://code.google.com/p/android-test-kit/) and Cucumber (https://code.google.com/p/android-test-kit/) 3 | 4 | Run Gradle task "runCucuTests" 5 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /MyApplication/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Dec 06 02:27:36 MSK 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/menu/menu_secret.xml: -------------------------------------------------------------------------------- 1 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /MyApplication/cucumber_reports/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Cucumber Features 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /MyApplication/app/src/androidTest/java/habrahabr/ru/myapplication/test/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package habrahabr.ru.myapplication.test; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My Application 5 | Hello Habrahabr! 6 | Settings 7 | Осталось попыток %d 8 | SecretActivity 9 | Введите имя пользователя и пароль 10 | 11 | 12 | -------------------------------------------------------------------------------- /MyApplication/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | mavenCentral() 7 | 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:1.0.0' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | jcenter() 21 | mavenCentral() 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/activity_secret.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MyApplication/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /MyApplication/.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | /*/build/ 3 | 4 | # Crashlytics configuations 5 | com_crashlytics_export_strings.xml 6 | 7 | # Local configuration file (sdk path, etc) 8 | local.properties 9 | 10 | # Gradle generated files 11 | .gradle/ 12 | 13 | # Signing files 14 | .signing/ 15 | 16 | # User-specific configurations 17 | .idea/libraries/ 18 | .idea/workspace.xml 19 | .idea/tasks.xml 20 | .idea/.name 21 | .idea/compiler.xml 22 | .idea/copyright/profiles_settings.xml 23 | .idea/encodings.xml 24 | .idea/misc.xml 25 | .idea/modules.xml 26 | .idea/scopes/scope_settings.xml 27 | .idea/vcs.xml 28 | *.iml 29 | 30 | # OS-specific files 31 | .DS_Store 32 | .DS_Store? 33 | ._* 34 | .Spotlight-V100 35 | .Trashes 36 | ehthumbs.db 37 | Thumbs.db -------------------------------------------------------------------------------- /MyApplication/app/src/androidTest/java/habrahabr/ru/myapplication/test/CucuRunner.java: -------------------------------------------------------------------------------- 1 | package habrahabr.ru.myapplication.test; 2 | 3 | import android.os.Bundle; 4 | import com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner; 5 | import cucumber.api.android.CucumberInstrumentationCore; 6 | 7 | public class CucuRunner extends GoogleInstrumentationTestRunner{ 8 | private CucumberInstrumentationCore helper; 9 | 10 | public CucuRunner() { 11 | helper = new CucumberInstrumentationCore(this); 12 | } 13 | 14 | @Override 15 | public void onCreate(Bundle arguments) { 16 | helper.create(arguments); 17 | super.onCreate(arguments); 18 | } 19 | 20 | @Override 21 | public void onStart() { 22 | helper.start(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /MyApplication/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /MyApplication/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Stabilitron 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/java/habrahabr/ru/myapplication/SecretActivity.java: -------------------------------------------------------------------------------- 1 | package habrahabr.ru.myapplication; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.Menu; 6 | import android.view.MenuItem; 7 | 8 | 9 | public class SecretActivity extends Activity { 10 | 11 | @Override 12 | protected void onCreate(Bundle savedInstanceState) { 13 | super.onCreate(savedInstanceState); 14 | setContentView(habrahabr.ru.myapplication.R.layout.activity_secret); 15 | } 16 | 17 | 18 | @Override 19 | public boolean onCreateOptionsMenu(Menu menu) { 20 | // Inflate the menu; this adds items to the action bar if it is present. 21 | getMenuInflater().inflate(habrahabr.ru.myapplication.R.menu.menu_secret, menu); 22 | return true; 23 | } 24 | 25 | @Override 26 | public boolean onOptionsItemSelected(MenuItem item) { 27 | // Handle action bar item clicks here. The action bar will 28 | // automatically handle clicks on the Home/Up button, so long 29 | // as you specify a parent activity in AndroidManifest.xml. 30 | int id = item.getItemId(); 31 | 32 | //noinspection SimplifiableIfStatement 33 | if (id == habrahabr.ru.myapplication.R.id.action_settings) { 34 | return true; 35 | } 36 | 37 | return super.onOptionsItemSelected(item); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /MyApplication/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 11 | 16 | 20 | 21 | 26 | 32 |