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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Visual Studio应用程序中心:appium-test-extension-1.0.jar;打开zip文件时出错相关的知识,希望对你有一定的参考价值。

我试图在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 - >这一步没有用。

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

答案

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

以上是关于Visual Studio应用程序中心:appium-test-extension-1.0.jar;打开zip文件时出错的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Visual Studio 代码中创建和部署函数应用程序?

安装 Visual Studio,连接中国区 Azure

Visual Studio测试运行:从测试中心的测试计划运行编码的UI自动化测试

Visual Studio 2017的安装与使用

无法在 Visual Studio 2019 中使用诊断工具

软件技巧(8)---- Ubuntu 开发环境搭建/Visual studio code 使用技巧