2016-08-20 10 views
1

TestObjectのGradleビルドプラグインを使用して私のEspressoテストの実行を自動化しようとしています(https://testobject.com/blog/2015/11/testobject-gradle-plugin.html参照)。私はこのように私gradle.buildファイルを変更した:Jenkins CI - TestObjectのGradle Build Pluginを使用したテストの自動化

buildscript { 
    repositories { 
     mavenCentral() 
     maven { url 'http://nexus.testobject.org/nexus/content/repositories/testobject-public-repo' } 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.2' 
     classpath 'com.android.tools.build:gradle:0.12+' 
     classpath group: 'org.testobject', name: 'testobject-gradle-plugin', version: '0.0.39' 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

apply plugin: 'android' 
apply plugin: 'testobject' 

android { 
    compileSdkVersion 24 
    buildToolsVersion '24.0.0' 
lintOptions { 
     abortOnError false 
    } 
    defaultConfig { 
     applicationId "com.domain.appname" 
     // For production release, this should be v17 
     minSdkVersion 18 
     targetSdkVersion 24 
     versionCode 2 
     versionName "0.1.7" 
     multiDexEnabled true 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    dataBinding { 
     enabled = true 
    } 
} 

testobject { 
    username "username" 
    password "password" 
    team "team-name" 
    app "app-name" 
    testSuite 8 
    runAsPackage true 
    failOnUnknown true 
    sizes = ["small","medium","large"] 
} 

dependencies { 
    androidTestCompile 'com.android.support.test:runner:0.3' 
    androidTestCompile 'com.android.support.test:rules:0.3' 
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' 

    androidTestCompile 'com.android.support:support-annotations:24.0.0' 
    compile 'com.android.support:appcompat-v7:24.0.0' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.parse.bolts:bolts-android:1.+' 
    compile 'com.parse:parse-android:1.+' 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.google.android.gms:play-services:9.0.1' 
    compile 'com.google.code.gson:gson:2.6.2' 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
} 

しかし、私は「Gradleのビルド」を実行したときにマニュアルで指定のように、それは「ビルド」ディレクトリ内のフォルダ「testobject」を作成しません。誰が私が間違ってやっていることを知っていると私はこれを解決する方法は? TestObject/Jenkins CIを使って私のテストを自動化する方法に関する他の提案(/チュートリアル)もありがたいです。

答えて

1

Androidプロジェクトには2つの異なるビルドディレクトリがあります。そのうちの1つはプロジェクトルートの下にあり、もう1つはappディレクトリの下にあります。 2番目のXMLの下にXMLを作成します。ビットさらに

find * -type d | grep testobject 

はちょうどあなたを助けるためにそれが唯一の推奨されているので、私は、あなたがrunAsPackageコンフィギュレーションを設定しないことをお勧めします、:あなたのプロジェクトのルートフォルダに、このコマンドを実行する場合は、簡単にフォルダを見つけることができますカスタムテストランナーを使用する顧客に提供します。すべてのテストを実行したい場合は、サイズの設定も必要ありません。

関連する問題