android-instrumentation

The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin

ε祈祈猫儿з 提交于 2019-11-29 00:50:25
I updated the AndroidStudio to version 3.1 Clean Project... and build failed The SourceSet 'instrumentTest' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something? However, the 3.0.1 version of AndroidStudio does not have this problem Detailed log: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':ios_dialog_lib'. at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate

Run all unit tests in Android Studio

孤街醉人 提交于 2019-11-28 10:39:43
I have this project in Android Studio : I wish to run all unit tests in all project with one click. How i can do it ? First, you can list all the test tasks available in your project with ./gradlew tasks Then you can choose the tasks you want to execute. If you want to execute all tests for all flavors ans all buildTypes, you just have to run ./gradlew test connectedAndroidTest If you don't want to remember all the gradle test command each time you want to run the tests, you can create a file "custom_tasks.gradle" and add task testAll(dependsOn: ['test', 'connectedAndroidTest']) { group =

No error still Android Studio says “no tests were found”

こ雲淡風輕ζ 提交于 2019-11-28 03:35:47
问题 I am trying to write an instrumentation test for my MainActivity. I followed the answers given here. Still Android Studio cannot find any tests. I have the class ApplicationTest.java in the androidTest folder. Here's the contents of the class: package com.example.monicamarcus.mymusicplayer import android.app.Activity; import android.test.ActivityInstrumentationTestCase2; import com.example.monicamarcus.mymusicplayer.MainActivity; public class ApplicationTest extends

Android Studio — clear application data for Instrumentation Test

孤者浪人 提交于 2019-11-27 23:37:25
How can I get Android Studio (AndroidJunitRunner) to clear application data preceding an instrumentation test without manually running adb command? I discovered that android.support.test.runner.AndroidJUnitRunner kind of cheats -- it never actually invokes connectedCheck or connectedAndroidTest . When run from command line $ gradle connectedCheck :MyMainApp:assembleDebug UP-TO-DATE :MyMainApp:assembleDebugTest UP-TO-DATE :MyMainApp:clearMainAppData :MyMainApp:connectedCheck When run from within IDE by clicking the instrumentation test configuration (green Android robot logo with red/green

AndroidX : No instrumentation registered! Must run under a registering instrumentation

不想你离开。 提交于 2019-11-27 17:16:04
问题 I'm trying to run a local unit test that depends on the context, and was following this guide: https://developer.android.com/training/testing/unit-testing/local-unit-tests#kotlin and I set up my project like this (following this link : https://developer.android.com/training/testing/set-up-project ): build.gradle(app) android { compileSdkVersion 28 buildToolsVersion '27.0.3' defaultConfig { minSdkVersion 21 targetSdkVersion 27 versionCode 76 versionName "2.6.0" testInstrumentationRunner