Dit*_*mon 3 android android-testing
我需要为android实现屏幕截图测试。
我已按照https://facebook.github.io/screenshot-tests-for-android/#gradle-setup上的步骤进行操作,并在我的 gradle 文件中包含以下内容
buildscript {
// ...
dependencies {
// ...
classpath 'com.facebook.testing.screenshot:plugin:0.9.0'
}
}
apply plugin: 'com.facebook.testing.screenshot'
Run Code Online (Sandbox Code Playgroud)
但是,我收到一个错误
评估根项目“app-android”时出现问题。未能应用插件 [id 'com.facebook.testing.screenshot'] 找不到名称为“androidTestImplementation”的配置。
我的 build.gradle 中有以下内容
androidTestImplementation 'androidx.test:core:1.1.0'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.multidex:multidex-instrumentation:2.0.0'
Run Code Online (Sandbox Code Playgroud)
我找不到任何证据表明我需要其他任何东西。
我也在https://github.com/facebook/screenshot-tests-for-android 上看到
你需要 python-2.7 才能让 gradle 插件工作,我们还建议安装 python-pillow 库,它是记录和验证屏幕截图所需的。
我已经安装了它并看到我有 2.7.16 版我还安装了枕头作为推荐(v6.0.0)
您可能需要移动此行:
apply plugin: "com.facebook.testing.screenshot"
Run Code Online (Sandbox Code Playgroud)
进入模块层面build.gradle。它必须低于这一行:
apply plugin: "com.android.application"
Run Code Online (Sandbox Code Playgroud)
因为这就是它的androidTestImplementation来源。
| 归档时间: |
|
| 查看次数: |
476 次 |
| 最近记录: |