Questions tagged [instrumented-test]

Framework for Android instrumented testing to interact with UI components.

116 questions
0
votes
2 answers

Espresso test class not found

I have created a basic Espresso test class that looks like the following: @LargeTest @RunWith(AndroidJUnit4.class) class ConfigurationsActivityTest { @Rule public ActivityTestRule mConfigsTestRule = new…
arttuOll
  • 3
  • 4
0
votes
1 answer

androidTest - Instrumented Android testing (Test depends on a Handler() object)

Now I'm busy testing some classes which are related to the BLE functionality. Therefore, I wrote some instrumented tests. There is one class that depends on a Handler() object. It's difficult to test more than one function because I'm using now…
0
votes
1 answer

How to test a function running a coroutine in an Android instrumented test?

In my Android Kotlin project, I have a class, with a function running a coroutine, that I want to test using an instrumented test (not unit test). Here is what it looks like: class DemoClass { fun demo(liveData: MutableLiveData) { …
matteoh
  • 2,810
  • 2
  • 29
  • 54
0
votes
1 answer

Is it possible to have a separate module for instrumented tests in android

We have a project, that has some instrumented tests that run part of CI Now we want to add some integration tests (of type instrumentation tests), but they should not run as part of pipeline, but on demand through a separate Jenkins job or command I…
vjrock
  • 26
  • 2
0
votes
0 answers

Espresso how to test background image set via getWindow.setDrawable()

In my main activity I observe Livedata and change the background accordingly using getWindow.setBackgroundDrawable(drawable)); My code: backgroundImageViewModel.getBackgroundImageLive().observe(this, new Observer() …
Gerke
  • 926
  • 1
  • 10
  • 20
0
votes
1 answer

In instrumented tests, how do you make Cloud Firestore write commands succeed when disabling the network?

So I am attempting to use the Cloud Firestore offline cache ONLY as an API for my instrumentation tests, to avoid having to read and write from the server database during my integration tests. First, in my test setup method, I call this…
0
votes
1 answer

Android Instrumented testing if the activity is opened via the onActivityResult callback

I am developing an Android application using Kotlin. I am writing instrumented tests for my code. Now I am struggling to write an instrumented test for a particular functionality. Following is the scenario I want to write test for. I have three…
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372
0
votes
1 answer

Android unit testing if an activity starts with a timeout or after a delay is not working

I am developing an Android application using Kotlin programming language. I am adding instrumented tests into my project. Now, I am having a problem with testing if an activity is started after a delay. I am using Espresso for instrumented tests.…
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372
0
votes
1 answer

How create an isolated context in Android for instrumented test

I want to run some test adding and getting accounts using AccountManager but I want to do the operations in a new context without the account I already have in the emulator. Is it possible to do that? Example of my…
Buntupana
  • 984
  • 1
  • 15
  • 33
-1
votes
1 answer

Manifest file error while execute first Android instrumented test

Am getting following error while am trying to execute android example instrumented test. As this is my first instrumented test which am getting error. Here is my Manifest file and gradle file. Android version 3.4.1 java version "1.8.0_152" Am new to…
-1
votes
1 answer

Test if text has been struck through

In an Android instrumented test I want to check that when selecting a checkbox, the checkbox applies the Paint.STRIKE_THRU_TEXT_FLAG paint flag to the text. Is there any way to check the paint flag of the text? The code being tested…
T. Green
  • 323
  • 10
  • 20
1 2 3 4 5 6 7
8