Visual Studio应用程序中心:appium-test-extension-1.0.jar;打开zip文件时出错

时间:2017-12-22 06:54:30

标签: automated-tests continuous-deployment appium-android visual-studio-app-center

我试图在VSapp中心配置我的测试用例,我的测试是用appium编写的。遵循以下步骤:

步骤1#添加了项目根文件夹中build.gradle中启用的JCenter存储库。 build.gradle文件如下所示

    buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

步骤2#在app文件夹内的build.gradle文件中添加了androidTestCompile('com.microsoft.appcenter:appium-test-extension:1.0')

apply plugin: 'com.android.application'



android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.keya.myapplication"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    androidTestCompile('com.microsoft.appcenter:appium-test-extension:1.0')
    def appCenterSdkVersion = '1.1.0'
    compile "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
    compile "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    testCompile 'org.assertj:assertj-core:2.0.0'
    testCompile 'org.testng:testng:6.8.8'

    compile files('libs/apache-mime4j-0.6.jar')
    compile files('libs/commons-codec-1.10.jar')
    compile files('libs/commons-collections-3.2.1.jar')
    compile files('libs/commons-io-2.4.jar')
    compile files('libs/commons-exec-1.3.jar')
    compile files('libs/commons-lang3-3.4.jar')
    compile files('libs/commons-logging-1.1.3.jar')
    compile files('libs/commons-validator-1.4.1.jar')
    compile files('libs/gson-2.3.1.jar')
    compile files('libs/guava-18.0.jar')
    compile files('libs/httpclient-4.4.1.jar')
    compile files('libs/httpcore-4.4.1.jar')
    compile files('libs/httpmime-4.4.1.jar')
    compile 'com.android.support:support-annotations:25.0.1'
    compile group: 'com.beust', name: 'jcommander', version: '1.27'




    testCompile 'info.cukes:cucumber-java:1.2.5'
    testCompile 'info.cukes:cucumber-junit:1.2.5'
    testCompile 'info.cukes:cucumber-picocontainer:1.2.2'




    compile 'com.android.support:support-v4:25.0.1'
}

apply plugin: 'maven'

task createPom {
    pom {
        withXml {
            def dependenciesNode = asNode().appendNode('dependencies')

            //Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
            configurations.testCompile.allDependencies.each {
                def dependencyNode = dependenciesNode.appendNode('dependency')
                dependencyNode.appendNode('groupId', it.group)
                dependencyNode.appendNode('artifactId', it.name)
                        dependencyNode.appendNode('version', it.version)
            }

            def profilesNode = asNode().appendNode('profiles')
            profilesNode.append(new XmlParser().parse('https://raw.githubusercontent.com/Microsoft/AppCenter-Test-Appium-Java-Extensions/master/gradleuploadprofilesnippet.xml'))
        }
    }.writeTo("pom.xml")}

在此步骤中,一切都成功构建成功但当我尝试导入以下库

import com.microsoft.appcenter.appium.Factory;
import com.microsoft.appcenter.appium.EnhancedAndroidDriver;

申请无法导入

Step3#我还尝试使用mvn导入libs - &gt;这一步没有用。

应用程序显示 无法解析符号 消息 任何人都可以向我建议解决方案吗?

1 个答案:

答案 0 :(得分:0)

找到问题的解决方案,只需将jar作为库添加到构建路径中并且工作正常