Questions tagged [android-espresso]
Espresso is a library which is used to write Android UI tests. It is also known as Google's Testing Tools For Android
3,355
questions
0
votes
0
answers
19
views
How catch an element in Espresso using source_id with out R.id
First I'm new in tests with Espresso.
I have a xml page and one element is something like that:
<node index="3" text="" resource-id="my_table" class="ScrollView&...
0
votes
0
answers
10
views
How to run one test in two devices doing different actions in each
I am trying to test a procedure involving Nearby interactive communications between two devices. I am not sure to be possible to mock the nearby services involving the communication, and I would like ...
0
votes
0
answers
34
views
Espresso test in an hybrid (Compose + XML) project
When i run my espresso test (see below) it cannot find a view by a given Text ("FindMeText"). Is it possible to execute some action on a Composable using espresso?
According to android docu ...
0
votes
0
answers
19
views
Espresso tests fail randomly with AppNotIdleException
I'm writing very long-running UI/integration tests, intending to go through the entire functionality of my app under various configurations, and I'm having problems with the overall stability and ...
0
votes
0
answers
15
views
Espresso UI test ignore onKeyPress Event Callback for React Native
I am trying to write Espresso UI tests for android, the app is built with react native, it's a secret Input component that can take digits as input and everything works fine manually, however on ...
0
votes
0
answers
13
views
How to add wait in espresso web view cases
onWebView(Matchers.allOf(isDisplayed(), isJavascriptEnabled())).withTimeout(5, TimeUnit.SECONDS)
.withElement(findElement(Locator.XPATH, "//div[@class='story-metadata-card__title-...
1
vote
0
answers
32
views
Gradle Managed Devices - Bluetooth keeps stopping
When running gradle managed devices via
./gradlew pixel4api32DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.xxx.xxx.xxx.Suites.CITestSuite -Pandroid.experimental.androidTest....
2
votes
2
answers
42
views
Can't use Espresso test parameter injector with org hamcrest Matchers?
Within an existing project with espresso tests, I want to parameterized espresso tests so I add in the project configuration the declaration
implementation 'com.google.testparameterinjector:test-...
0
votes
0
answers
11
views
Espresso test NumberPicker
I'm using a numberPicker on my Android app, and I want to make some E2E tests to check it. I made a customView that holds the NumberPicker that looks like this:
<?xml version="1.0" ...
0
votes
1
answer
40
views
Espresso onData with check (assertion) on data object instead of View
I have a ListAdapter for objects of type Foo. These objects have fields int id and double quantity.
In my Espresso tests, I would like to assert that the data entry with id = 5 has quantity = 10.
(...
0
votes
0
answers
75
views
Android studio test not running says 0 passed and tests cancelled
Here's the repo. This is what I see. And this is another warning that appears.
I can see the test running in the emulator only when I run the whole androidTest folder, but IDE doesn't seem to know ...
1
vote
0
answers
28
views
Updating Android material version causes Firebase tests to fail for but still passes locally
Recently I updated com.google.android.material:material from 1.4.0 to 1.9.0 and noticed FTL tests on TextInputLayout with MaterialAutoCompleteTextView started to fail consistently.
After some version ...
0
votes
0
answers
9
views
How can I automate integration testing for secondary displays on Android?
Our app is deployed on POS systems that have a customer-facing-display. I’m having trouble coming up with a good solution for automating testing around the content on the secondary screen. We ...
0
votes
0
answers
19
views
Espresso Testing UI in androidTests Fails when run on Gradle ManagedDevice
I have a UI test that when I run it on an emulator or real device it works. When I run it on the gradle managed device it fails.
I have a list of items that I click on in NestedScrollView. About 2/3 ...
0
votes
0
answers
26
views
How to generate an Espresso test report from the command line [duplicate]
When running Espresso tests from the command line, I need to also generate a test report.
I run my tests from the command line in the standard way:
adb -d shell am instrument -w -e log true -e package ...
0
votes
1
answer
29
views
Android Kaspresso (Kakao) how to pick file from downloads
How to pick file from Downloads folder with Kaspresso/Kakao/UI Automator? Cannot find any info about it.
0
votes
0
answers
14
views
How to configuring Android Instrumentation driver
I executed the below command for the automation suite.
./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.sample.easyprefs.kotlin.TestSuite -i
I got the results ...
0
votes
0
answers
61
views
Error during BDD-Test for Android: java.lang.IllegalStateException: No compose hierarchies found in the app
I have bdd-test for my app , I use compose and espresso, and I have this error :
java.lang.IllegalStateException: No compose hierarchies found in the app. Possible reasons include: (1) the Activity ...
0
votes
0
answers
23
views
android, how to grant the permission from espresso
On OS 13 and above the app opens the OS permission prompt to ask user grant the permission.
if (ContextCompat.checkSelfPermission(context, android.Manifest.permission.POST_NOTIFICATIONS) != ...
0
votes
0
answers
91
views
Appium espresso driver server start failure
Trying to connect to appium server using appium inspector(espresso driver). Server successfully started with uiautomator2, but failing with espresso driver. Can someone help here.
Below are the driver ...
0
votes
1
answer
48
views
How do I use Uri.parse() method while testing?
I am working on an Android Project and I wanted to store the URI of a resource in a Database using Room Library.
Since Room does not support complex data types, therefore I created a TypeConverter ...
0
votes
0
answers
33
views
Espresso. intent matcher not matching
i have this part to match intent
intended(allOf(
hasAction(Intent.ACTION_VIEW),
hasData(Uri.parse("http://www.ya.ru/")),
toPackage(...
0
votes
0
answers
13
views
Android espresso automation test, I can not detect the correct text displayed in TextView
The implementation looks like this:
<TextView
android:id="@+id/tv_grade_percentage"
android:layout_width="wrap_content"
android:layout_height="...
0
votes
0
answers
18
views
android, the test is failing caused by emoji button on the soft keyboard
Having an espresso test that will type in the editView.
<EditText
android:id="@+id/displayNameEditText"
android:layout_width="50dp"
android:...
0
votes
0
answers
12
views
How can I check the state of a menu item in Espresso? I am testing a Kotlin android application
I am testing whether the right message is displayed after unfavoriting a recipe. To prepare for the test, I am conditionally checking whether it is already favorited. If it isn't, I favorite it in the ...
0
votes
1
answer
23
views
Android Cucumber UI test problem with com.google.android.material
I wrote a test scenario with the help of Cucumber and espresso and when I run the test it crashes wherever I use the com.google.android.material library.
For example :
com.google.android.material....
2
votes
1
answer
103
views
Since Compose BOM 2023.08.00, instrumented tests are failing, because lazy list changes seem to be leaving old nodes in the hierarchy
Jetpack Compose version: Compose BOM 2023.08.00
Jetpack Compose component(s) used: Foundation, material, animations, livedata, ui-tooling, viewmodel
Kotlin version: 1.9.10
Steps to Reproduce or Code ...
1
vote
0
answers
64
views
Android Gradle Managed Devices - Unable to Retrieve Device Error
When trying to run multiple gradle managed devices, on one machine we get the error
"Unable to retrieve 2 devices, only 1 available. Proceeding to run tests on 1 shards."
Running using this ...
-1
votes
1
answer
32
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 ...
0
votes
0
answers
28
views
Best framework to integrate with Compose Tests for a Native Android App?
I'm planning to create a framework on Compose Test for Native android app, what's the best framework architecture i can use? The framework should be robust enough to handle all the aspects of Test ...
1
vote
1
answer
62
views
Delay in LaunchedEffect break espresso test
I have a test as follows:
@get:Rule(order = 1)
val composeRule: ComposeRule = createAndroidComposeRule()
@Test
fun test() {
composeRule.setContent {
var text by remember { mutableStateOf(&...
0
votes
0
answers
20
views
How to write code for Custom Chrome Browser Automation in Espresso
@Test
fun customChromeBrowserTesting() {
//click Run Ad button
Thread.sleep(5000)
onView(withId(R.id.button_reward_action)).perform(click())
onView(withId(R.id.buttonText)).perform(...
1
vote
1
answer
61
views
Parse an XML Unit Test File with XMLLINT in Bash Script putting into Arrays for Success and Failures
I am running a script file on CircleCI where I do my UI unit tests and I need to parse the resulting XML from android and then find the specific tests that succeeded put them in a list and then take ...
0
votes
0
answers
62
views
Can i use espresso to test jetpack compose UI
I have an existing test automation framwork that i want to reuse for a testing of new android application built in jetpack compose
I found a way to put resource ids in compose ui element but espresso ...
0
votes
0
answers
98
views
Change activity details during use of ActivityScenarioRule
I'm using ActivityScenarioRule to run tests of my activities. Each activity has its own view model, which gets created within onCreate-method.
I would like to test same activity with different ...
0
votes
0
answers
8
views
How to assert a textview that displays only for few seconds in espresso automation
I'm trying to automate a flow which displays a textview for about 5 seconds. I'm unable to assert that text. Any help?
I tried using uiautomator and few other options. Nothing worked so far. ...
0
votes
0
answers
21
views
How do I dictate the order of how tests are run while running espresso tests for my android app?
Upon running the test class, the tests inside the class are run randomly not in the order I have written them and which where causing a cache which I solved with orchestrator
I expected the test to ...
0
votes
1
answer
33
views
How can I get rid of the 'keeps stopping' notification which destroys subsequent UI tests in Android?
I have running some UI tests, and when 1 fails, other ones will also fail because this annoying notification is shown:
Ofcourse I can add additional logic to check if this dialog is open, but ...
0
votes
2
answers
187
views
+400
How to relaunch an app with Compose within the same test
Essentially I am just looking for an equivalent of https://developer.apple.com/documentation/xctest/xcuiapplication/1500637-terminate combined with https://developer.apple.com/documentation/xctest/...
3
votes
0
answers
72
views
Run Espresso/Cucumber UI testing for modular project in Android
I wrote a UI test scenario by Cucumber and Espresso for a modular Android project.
This project has a module that depends on the Base module.
When I run the test I got an error in the xml layout, ...
0
votes
1
answer
36
views
Android: How to test a searchView within an AppBarLayout
This is my code:
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
android:layout_width="match_parent"
...
0
votes
0
answers
9
views
Button in child of rv changes how to test: Android
I have a recyclerView with a bunch of childs. Each child has an ImageButton to mark as favourite. Once you click the fav button, the image changes from a white bookmarck with a gray border to a yellow ...
0
votes
0
answers
15
views
Mock / Simulate hardware in espresso tests
I'm developing and android app and using Espresso as the auto-test framework.
I've automated the UI related test-cases, but I am stuck at one which needs to read a NFC tag.
Is there any way I can ...
0
votes
0
answers
25
views
How to resolve/replace library used in Espresso tests 'Unresolved reference: common'
I have inherited an Espresso test project. The app builds, but the AndroidTest fails with this error, "Unresolved reference: common".
It is importing a library 'com.google.common.truth.Truth'...
0
votes
1
answer
34
views
Android-Espresso test a ProgressDialog is displayed and then dismissed
I have a situation when I show a progress-dialog when data is being fetched in the background (either from local room database or from an API endpoint).
Once the data fetching is done (either ...
0
votes
2
answers
257
views
Kakao/Kaspresso matching in RecyclerView with different ViewTypes
I'm having issues operating a RecyclerView with different ViewTypes in my UI tests with Kakao:
The RecyclerView is used for an Auto Completer and has two ViewTypes:
regular results (...
0
votes
0
answers
72
views
Android Instrumentation test failing
I am trying to write a test oAuth2 login through custom tab and capture the code through deep link from custom tab. I Expect that test should be passed. But it failed the following log.
java.lang....
0
votes
0
answers
36
views
Android Studio ask to update Kotlin plugin but no update available
I'm recently update Espresso test libraries in my Android project. Here are some part of my build.gradle.
buildscript {
ext {
gradle_version = '4.1.3'
kotlin_version = '1.4.32'
...
0
votes
0
answers
25
views
Android. How i can shake emulator in test with kotlin
I try exec command Runtime.getRuntime().exec("sh -c 'adb emu sensor set acceleration 100:100:100; sleep 1; adb emu sensor set acceleration 0:0:0'")
But is not work
Also a try
Runtime....
0
votes
0
answers
199
views
Cucumber Message : To disable this message, add cucumber.publish.quiet=true to cucumber.properties
I write code using cucumber android studio and espresso but I couldnt implement cucumber to my project.I get the following error :
enter image description here
Later I created new properties file such ...