532 questions
0
votes
1
answer
47
views
Unable to run Android instrumented tests due to protobuf incompatibility
I am trying to run very basic Android instrumented test, but it fails with:
Caused by: org.gradle.api.GradleException: There were failing tests. See the report at: file:///Users/someuser/projects/...
1
vote
0
answers
29
views
How to test toast in Android Instrumented Test with Compose?
I want to write instrumented tests for Android UI's toasts. But it seems my codes are not working. It can't catch the toast when it's actually displayed on phone. I think possibly issue with my toast ...
0
votes
0
answers
35
views
Flutter inAppWebView Instrumentation Test
I created a working android app using a flutter inAppWebView.
Is it possible to perform an instrumentation test with firebase test lab?
Basically I need to fill input texts, click buttons, download ...
1
vote
0
answers
163
views
HiltTestRunner not found during instrumented tests – ClassNotFoundException
I'm trying to run instrumented tests in my Android project using Hilt for dependency injection. However, the test run fails with the following error:
Test run failed to complete. Instrumentation run ...
0
votes
0
answers
38
views
Jetpack Compose How to use Drag and drop in Test
I have the following problem:
What I want to do is test the drag and drop functionality with instrumentation tests in android jetpack compose.
I have simplified the problem once and added a very small ...
0
votes
0
answers
18
views
androidTest package autocompletion won't work
Android Studio; Jetpack Compose
Title. When writing tests, autocompletion won't work. Only after writing out Composables/Functions I can import them and everything works. Still no autocompletion is ...
0
votes
1
answer
38
views
Espresso Test for Activity with Forced Portrait Mode Fails Orientation Assertion
I am testing an Android app using Espresso, and I have an activity that should only be displayed in portrait mode. To enforce this, I programmatically lock the activity in portrait mode when it is ...
0
votes
1
answer
25
views
Custom report path & name on Android instrumented tests? [closed]
Is it possible to change the report name to include the timestamp on Android instrumented tests? I couldnt' find any documentation on this nor do i know where to begin investigating to be completely ...
0
votes
1
answer
58
views
Unable to resolve duplicate class issue while adding dependencies in Android gradle for writing instrumented tests for Composable UI
I have a complex project where version for
org.jetbrains.kotlinx:kotlinx-coroutines-android
is forced to 1.6.4.
I have used Jetpack composables for my UI screens. I want to write Instrumented Tests ...
0
votes
1
answer
76
views
How to prevent Firebase Test Lab from granting all apps permissions?
I'm running end-to-end tests on my Flutter app's Android version using the Patrol package. When I run these tests locally, the app requests permissions from the user (specifically for Bluetooth and ...
0
votes
1
answer
51
views
Custom gradle task not executing after failed 'connectedAndroidTest'
I have an android project with instrument tests.
I am trying to run a custom gradle task immediately after connectedAndroidTest.
I want this custom task to run irrespective of the connectedAndroidTest ...
1
vote
0
answers
176
views
execution failed for task ':app:connecteddebugandroidtest
My instrumentation test is not executed in the device after the test and app install. The test sometimes keep "building" for long times +15min
Here is the logcat with warnings and info ...
1
vote
0
answers
44
views
Firebase Test Lab auto grant permissions for UI tests
Is there any documentation stating FTL installs the app with the -g flag, meaning manifest permissions are automatically granted? I cannot find in my digging. Thanks!
I looked into firebase test lab ...
0
votes
0
answers
99
views
Unable to Transform with Android Gradle Plugin
I’m Trying to Intercept Some Methods Using the Byte-Buddy Android Gradle Plugin
I want to intercept some methods using the Byte-Buddy Android Gradle plugin. Here are the versions I am using:
• Java ...
1
vote
0
answers
79
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:...
2
votes
3
answers
607
views
Change app language/locale programmatically in jetpack compose during instrumentation/UI test on Android
The app supports 2 locales. During instrumentation or UI test, I want to test with a specific language (such as EN). Referring 6629458, I made a function for changing the locale in kotlin:
private fun ...
4
votes
1
answer
392
views
Intrumentation test using androidx.datastore version 1.1.1 now fails with UncompletedCoroutinesError
I updated these implementations in app/build.gradle from 1.0.0 to 1.1.1:
implementation "androidx.datastore:datastore-preferences:$androidXDatastore"
implementation "androidx.datastore:...
1
vote
0
answers
42
views
How to generate apks with different ABIs for instrumentation tests?
I can get multiple apks for different ABIs of my app when I add this to build.gradle:
android {
splits {
abi {
enable true
universalApk true
}
}
}
as ...
1
vote
1
answer
724
views
How to grant permission in flutter integration tests?
I have setup integration tests for firebase using guide. I am running the same tests at local using following command:
flutter build apk --debug --flavor dev
./gradlew app:...
0
votes
1
answer
178
views
Firebase testlab for Flutter app always gives timeout
In my flutter app I did all the integration steps to run a test lab test
I created MainActivityTest.java, and updated the build.gradle with the test dependencies
I created the integration test ...
1
vote
2
answers
344
views
Skip androidx.startup when running instrumented tests
I have some startup initializers defined in my manifest file.
<meta-data
android:name="com.myapp.MyInitializer"
android:value="androidx.startup" />
That initializer is ...
0
votes
1
answer
124
views
Proper Espresso test setup for Fragment with RecyclerView using Databinding
I've been facing an issue when trying to run instrumented tests for a fragment.
With the code below, the test starts but looks like it never launches the fragment, gets stuck on loading. I need to ...
1
vote
2
answers
302
views
Firebase test lab Instrument test in that requires google login
I've developed an Espresso instrumentation test for an app built with React Native. The test involves a "Login with Google" button, which initiates an OAuth flow. On a local device or ...
0
votes
1
answer
468
views
How to print logs in flutter integration tests running via gradlew
I have followed guide to run tests at local as well Firebase test lab.I am using following command to run at local:
flutter build apk --debug ...
2
votes
1
answer
111
views
Huge APK size for test app when using separate Module for Instrumentation Test
I have a multi-module app and recently, I moved the instrumented tests to a single and separate module.
My setup seems fine since I can build, run unit tests and also instrumented tests.
I just ...
-1
votes
1
answer
110
views
How to run all android instrumentation tests on multiple devices parallelly
I'm trying to run all my espresso tests on multiple devices simultaneously using adb shell am instrument command. Wondering if there is a way. I'm not trying to distribute my tests across devices, i ...
1
vote
1
answer
1k
views
Frida-Gadget not working with Android's app_process
I want to instrument a Java program on my Android device via a Frida-Gadget but I am failing to get it to work. Here are the steps i took.
First of all here is the code of a simple Java program:
...
1
vote
1
answer
2k
views
MockWebServer is getting error HTTP FAILED: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:8080
I'm working on Android instrumentation tests with MockWebServer of Square. Here are the codes that I'm trying to run. However, I'm getting error from Okhttp client, when I ran the test. I've added ...
2
votes
0
answers
188
views
Android instrumentation test only works for app module
I a have multi module android app. I need to write some instrumentation test for my app but only instrumentation test from app module are working. These tests run fine and either pass or fail but ...
3
votes
0
answers
1k
views
Hilt injection with android instrumented tests
I am running into the following exception when running a test for a composable that injects a hilt view model, eg:
@Composable
fun MyScreen(
viewModel: MyViewModel = hiltViewModel()
) {
}
...
0
votes
1
answer
226
views
Error using Hilt instrumentation TestCase Installin for SingletonComponent
I'm getting the following Hilt error when I try to use a TestCase module to provide mocks for my instrumentation testing.
Here is the error
[Hilt]
public final class TestModules {
^
@...
5
votes
1
answer
986
views
java.lang.IllegalStateException: Dispatchers.Main is used concurrently with setting it Crash during instrumentation tests
I've been trying to nail down a particularly nasty crash during my tests that occur when setting up/using Dispatchers.Main value. I see this issue about once every 10 or so runs.
Example stack trace:
...
3
votes
0
answers
744
views
Test run failed to complete. Instrumentation run failed due to Process crashed
Issue: I am using Github Actions for CI and after pushing the code into Git CI workflow runs and showing me an error on FCMService file. Previously there were no error was showing on this file before ...
3
votes
0
answers
143
views
Is it possible to trigger process death scenario in an android instrumentation test?
Google didn't help and I don't think there is a straightforward way to do this with android instrumentation tests
class TestWithActivity {
@get:Rule
val composeRule: TestActivityRule = ...
1
vote
1
answer
283
views
Android Instrumentation Test: Run code on host machine (not on device)
I'm trying to use Testcontainers in my Android instrumentation tests because I want to start a webserver before the tests which my app is using.
The problem is that all code that is executed in the ...
2
votes
0
answers
208
views
How to make an instrumentation test for a fragment that is using activityViewModels?
So my setup is that I initialize all the viewModels on MainActivity then use activityViewModels to the Fragments that don't need their own instance of the viewModels. Then I wanted to create an ...
4
votes
1
answer
2k
views
Android Compose LaunchedEffect with delay stuck in instrumentation tests
I implemented custom simple splash screen with compose navigation. To navigate to main screen after short period of time I used LaunchedEffect with delay inside. It works fine. But in UI test the ...
12
votes
2
answers
5k
views
Test run failed to complete. Instrumentation run failed due to Process crashed. with debugger inside a module
I'm starting to implement instrumentation testing for my company to increase our code quality and speed of deployment. I'm rewriting a module of our application and I'm trying to implement TDD ...
2
votes
2
answers
465
views
Accessing Storage From Orchestrated Espresso Test
I have a test apk being built, and I'd like that test apk to be able to read some configuration values from an external file, rather than having to compile that configuration into the apk file.
I have ...
0
votes
1
answer
257
views
How to write Android instrumented UI test for native Camera activity
I have a MainActivity with a button that will launch the native Camera Activity via Intent(MediaStore.ACTION_IMAGE_CAPTURE). I would like to write an Android UI test that will:
Confirm we are on the ...
1
vote
0
answers
179
views
How can I create an Android end-to-end test for a specific user flow?
The aim is to create end-to-end tests for a native Android app, that allows us to validate the "happy path" and alleviate our QA burden of manually carrying out these tasks.
In the project, ...
1
vote
0
answers
32
views
JUnit 4 in Android starts and process is quickly killed and no exceptions too
**Below is the class. As soon as the SOUT prints within a second it completes. Tested in debug mode and same.
Logcat shows that process is ended. No Exception is observed. Code compiles without any ...
0
votes
2
answers
683
views
Instrumented test is stuck on "Connected to process"
When I try to run the ExampleInstrumentedTest on my Android Studio project, it builds fine, installs the test and then it is stuck on "Connected to process ####..." and no test results are ...
0
votes
1
answer
349
views
Gradle failed to resolve: com.squareup.spoon:spoon-client:2.0.0-SNAPSHOT
I'm trying to use the Spoon plugin for my Instrumentation Tests, but I am unable to proceed with a Gradle error unable to resolve dependency Failed to resolve: com.squareup.spoon:spoon-client:2.0.0-...
3
votes
0
answers
453
views
Android Instrumentation Orchestrator's `clearPackageData` does not clear data
I have defined these into my build.gradle, to enable Orchestrator in my Android Instrumented tests:
defaultConfig {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
...
2
votes
1
answer
673
views
Instrumentation tests don't ask for user permissions in Firebase Test Lab
When I run instrumentation tests in Firebase Test Lab, the system dialogs asking the user to grant permissions don't come up, as if they were approved without the need for user action. For example ...
0
votes
1
answer
712
views
Android instrumentation does not start on a second device
Since some time, when I run an instrumentation test on a device (emulator) and try to start another test on a second device in parallel, I get the following exception:
FAILURE: Build failed with an ...
3
votes
0
answers
80
views
Android Billing test purchase id deprecated?
I used test puchase ids such as "android.test.purchased" for my instrumentation tests. When I last run these tests they failed on every device, as the dialog does not show any "Purchase ...
2
votes
2
answers
902
views
How to get the current webview object in Android?
I am using Datadog to track user activity in my app. Now I need to instrument webviews. After initializing datadog's sdk , its documentation says that I have to call the following code snippet:
...
1
vote
1
answer
335
views
Instantiate Hilt Worker for Instrumentation Testing?
I am having problem trying to initialize my WorkerGetData class for instrumentation testing. I have done the following:
removed the default work initializer in manifest file.
added configuration ...