Android Test Orchestrator不适用于Android X [英] Android Test Orchestrator not working with Android X

查看:263
本文介绍了Android Test Orchestrator不适用于Android X的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将项目迁移为使用AndroidX,并使用以下文档在gradle上为我的意式咖啡测试配置了测试编排器:

I have recently migrated my project to use AndroidX, and have configured test orchestrator for my espresso tests on gradle using the following docs:

https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator

我有依赖性:

androidTestUtil 'androidx.test:orchestrator:1.1.0-beta01'

但是,我的所有测试均未执行,并且在运行gradle时运行以下adb shell命令,即它们似乎失败:

However, none of my tests are executed and looks like they fail when running gradle runs the following adb shell command i.e:

adb shell 'CLASSPATH=$(pm path android.support.test.services) app_process / \
  android.support.test.services.shellexecutor.ShellMain am instrument -w -e \
  targetInstrumentation com.example.test/androidx.test.runner.AndroidJUnitRunner \
  android.support.test.orchestrator/.AndroidTestOrchestrator'

从上面的内容来看:似乎它正在尝试使用android支持版本而不是androidx版本执行此命令.

from looking at the above: It seems like it is trying to execute this command with android support version as opposed to the androidx version.

在任何地方androidx上似乎都没有记载.

It doesn't seem to be documented anywhere what to use for androidx.

推荐答案

通过猜测,我在gradle配置中更改了以下内容

Purely by guessing, I changed the following in my gradle config

来自:

  testOptions {
    execution 'ANDROID_TEST_ORCHESTRATOR'
  }

  testOptions {
    execution 'ANDROIDX_TEST_ORCHESTRATOR'
  }

似乎一切正常.

这篇关于Android Test Orchestrator不适用于Android X的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆