Questions tagged [instrumented-test]
The instrumented-test tag has no usage guidance, but it has a tag wiki.
instrumented-test
120
questions
0
votes
0
answers
22
views
How to exclude app module from instrumented test?
After running ./gradlew connectedAndroidTest and removing androidTest directory and the any required setup with instrumented test from my app module build.gradle.kts, the task :app:...
0
votes
0
answers
17
views
How to test composables background?
I have an application written in compose and I want to test it's background based on state stored in viewmodel and interaction with the composable item, like:
Box(
modifier = Modifier
...
0
votes
0
answers
46
views
Cannot run Android Instrumentation test when enable R8
My app recently enabled the R8. My app can run fine when R8 is enabled. The UI Test can run when R8 is disabled, but when enabled, I got the "Caused by: java.lang.ClassNotFoundException: Didn't ...
1
vote
1
answer
119
views
Kotlin Compose instrumented UI test: How to perform drag and drop on the screen?
I'm currently working on a composable screen that looks something like this:
Those tiles are draggable, you can reorder them by dragging it and moving it to another place. And this is what I want to ...
0
votes
0
answers
96
views
How to fix Java.lang.IllegalStateException: Given component holder class androidx.activity.ComponentActivity does not implement interface dagger.hilt
I have a compose screen and inside my screen, I am initialising my viewmodel. I am trying to write androidTest for this screen. And I am getting above error. How should I modify code to avoid ...
0
votes
0
answers
24
views
Interpreting Coefficients in 2SLS Model
I am currently working on a 2SLS model where I instrumented the logarithm of per capita transfers with the unemployment rate from each country that the transfers originate from (also taking logarithms—...
1
vote
1
answer
71
views
Run instrumented test with Gradle while skipping build and installation
Is there a way to run instrumented test with Android Gradle Plugin without running a build task and installation task? I need to do the installation of test APKs via adb for a very specific reason, ...
0
votes
0
answers
18
views
Does Dagger 2 supports Instrumented Test in Android?
Is it possible to use Dagger 2 Android for instrumented test in a multi module project? I can't see related articles and SO question so here it is.
Custom runner
/**
* Custom AndroidJUnitRunner to ...
0
votes
1
answer
48
views
Google Truth.assertThat.contains does not behave similar to List.contains
Using List.containsAll() and Truth.assertThat(list).contains(originalList) behaves differently.
Working as expected
assertThat(getItemsByChannelId.containsAll(entitiesChannelAPage2)).isTrue()
Not ...
0
votes
0
answers
13
views
Zero tests started with gradle connectedAndroidTest or gradle connectedDebugAndroidTest
I have some Espresso tests in Android studio in kotlin
Executed "gradle connectedAndroidTest" and "gradle connectedDebugAndroidTest" from cmd having emulator from Android studio ...
0
votes
1
answer
52
views
Run instrumented test inside module's androidTest
Is it possible to run an instrumented test in an Android module that has no activity but uses AppCompat dependencies? I am attempting to run a simple test but only works if moved to app module.
Util ...
0
votes
0
answers
54
views
Android Java Room.inMemoryDatabaseBuilder for Instrumented tests using Espresso
I need help to use Room.inMemoryDatabaseBuilder for my Instrumented tests
In my Instrumented class I added this :
private MyDatabase database;
@Rule
public InstantTaskExecutorRule ...
2
votes
1
answer
78
views
Android instrumented tests BouncyCastle exception
Some time ago, my instrumented tests stopped working. I get an exception trying to sign the test apk from BouncyCastle. I did a git bisect to find the commit where the tests stopped working. I ...
2
votes
0
answers
81
views
Override resource files in Android instrumented tests
Disclaimer: related but different from this, this and this.
I would like to point AndroidManifest.xml to an xml resource file like this:
<application
[...]
android:...
0
votes
0
answers
176
views
Instrumented test uses main AndroidManifest instead of the test version
I am trying to uses OkHttp in some Android instrumented tests, but I get the following error:
java.net.UnknownServiceException: CLEARTEXT communication to localhost not permitted by network security ...