Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Espresso test fails due to Android message `Viewing full screen, To exit, swipe down from the top`

I have an espresso test which fails due to the Android pop up message which comes up Viewing full screen. To exit, swipe down from the top.

If I click Got it the test runs okay, but I have these tests running on build server where I cannot manually click it.

Emulator device I am running on - Nexus 7 API 23.

Is there a way I can disable this popup to come up or click it during the tests, but I am not sure though at what point this will popup.

Any ideas on how to handle this please.,

This is the popup Android throws which breaks the espresso test

enter image description here

I do get an error message due to this, which is as follows

Error on this line -

 onView(withId(R.id.prefuel_total))
                .perform(typeText(value), closeSoftKeyboard());

    androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 1067, 321 and precision: 16, 16' on view 'Animations or transitions are enabled on the target device.
For more info check:

with id: com.ix.xx.staging:id/prefuel_total'.
at androidx.test.espresso.PerformException$Builder.build(PerformException.java:82)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:79)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:51)
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:312)
at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:173)
at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:114)
at com.ix.xx.test.AbstractFuelOrderDataTests.enterPreFuelDataInDialog(AbstractFuelOrderDataTests.java:503)
at com.ix.xx.test.FuelOrderDataTests.testAcBatchOnlyProgress(FuelOrderDataTests.java:2782)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at androidx.test.internal.runner.junit4.statement.RunAfters.evaluate(RunAfters.java:61)
at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:527)
at org.mockito.internal.junit.VerificationCollectorImpl$1.evaluate(VerificationCollectorImpl.java:36)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.runner.AndroidJUnit4.run(AndroidJUnit4.java:104)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:388)
at com.ix.xx.test.runner.UnlockDeviceAndroidJUnitRunner.onStart(UnlockDeviceAndroidJUnitRunner.java:42)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Caused by: androidx.test.espresso.PerformException: Error performing 'Send down motion event' on view 'unknown'.

Thank you for ur help and suggestions R

like image 694
BRDroid Avatar asked Sep 06 '25 03:09

BRDroid


1 Answers

You can disable these popups with the following command:

 adb shell settings put secure immersive_mode_confirmations confirmed
like image 133
Mike Collins Avatar answered Sep 07 '25 16:09

Mike Collins