简体   繁体   English

如何使用Kotlin运行单个Android测试?

[英]How can I run a single Android Test using Kotlin?

I am using Kotlin 1.0.3 for Android Development in Unit Testing but when I try to run a single test it runs all tests of the class. 我在单元测试中使用Kotlin 1.0.3进行Android开发,但是当我尝试运行单个测试时,它会运行该类的所有测试。 Does anyone know how to avoid that behaviour? 有谁知道如何避免这种行为?

There's an issue with the IntelliJ Platform that causes the tests for the entire class to be executed if you try to run a single test method and have an existing run configuration for the entire class. IntelliJ平台存在一个问题 ,如果您尝试运行单个测试方法并且整个类具有现有的运行配置,则会导致执行整个类的测试。

To run a single method, you need to delete the configuration for the entire class using the Run | 要运行单个方法,您需要使用Run |删除整个类的配置 Edit Configurations... action. 编辑配置...操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Gradle Android 运行单个仪器测试 - How can I run a single instrumentation test with Gradle Android 我如何运行一个Android工具测试用例? - How can I run a single android instrumentation test case? 如何使用 kotlin 以单一方法获取 android 屏幕上按钮的所有事件? - How can I get all the events of the buttons on a screen on android in a single method using the kotlin? 如何在 Android 项目中使用 kotlin.test? - How can I use kotlin.test with an Android project? 如何通过Android的ant构建脚本运行单个测试用例? - How can I run single test cases via Android's ant build script? 如何使用 Gradle 命令在 Android 中运行单个测试类? - How to run single test class in Android using Gradle command? 在您可以使用 Kotlin 访问某些页面之前,如何让我的 Android 应用程序连接到特定的单个 wifi - How can i make my Android application connect to a particular single wifi before you can have access to some pages using Kotlin 如何使用 Kotlin 在 Android Jetpack Compose 中获取上下文? - How can I get context in Android Jetpack Compose using Kotlin? 如何从 Android Studio 运行单个 Kotlin 类 - How to run single Kotlin class from Android Studio 如何使用 Kotlin 的视图绑定在 Android 中缩短此代码? - How can I shorten this code in Android using view binding by Kotlin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM