What App Center service does this affect?
Espresso Test runs
Describe the bug
Device animations are not disabled
To Reproduce
Steps to reproduce the behavior:
Run espresso tests
Expected behavior
Tests that pass locally should pass on App Center
Additional context
As per Espresso setup instructions all device system animations should be disabled. App Center support has confirmed that they are not disabled on App Center. We believe this is the cause of our test flakiness when running on App Center and this renders App Center UI testing useless to us. Please disable system animations on Android devices.
Thanks for reporting it, I have converted it to feature request. Were you able to get any help from our support?
Support basically just said "Sorry, we currently don't support disabling animations".
Same issue, about 20 tests are failing because of this, I also believe that this slowdown test execution
Is there a place where I can track the feature internally? Was it evaluated?
Hello everybody,
We're actively looking into options here.
Sorry for the slow response.
Hey guys.
I achieved to disable animations adding this option in build.gradle.
testOptions {
animationsDisabled = true
}
@douglascarvalho Does that work for all devices?
In the meanwhile, we're running an experiment where we have disabled animations on Motorola Nexus 6 running Android 5.0.1.
@Oddj0b I believe so, we tested on a Pixel 2 device. I think it is more related to Gradle version than device setup to work. It should work on Gradle 3.0+>
Has anyone else had success with this? My appcenter device is still enabling animations with
testOptions {
animationsDisabled = true
}
and gradle v3.5.3
Currently using a Nexus 5x, android 8.1.0
@rfogar2 Thank you for the feedback, we'll check the devices settings.
@rfogar2 The Nexus 5x running Android 8.1.0 have had their animation disabled. This is until we get a broader solution implemented that disables animation on Android devices.
@Oddj0b do you have a timeline for that? We are moving our tests to appcenter from Firebase and this is causing some tests to fail.
Thanks
@Oddj0b same here. UI tests with espresso are usually not robust at all if animations are turned on. Espresso usually delays searching for UI elements until the application is in some sort of idle state. Unlike other UI testing frameworks which mostly provide some sort of waitForElementX functionality. System animations seem to confuse espresso in determining this idle state.
@Oddj0b It doesn't seem like animations were disabled for the Nexus 5x on Android 8.1.0. I'm still having the same issues as before.
Hey guys, still facing same problem here. Do we have any updates?
I think I will move to another device farm. My code has a lot of animations and it has no sense to test on devices that cannot disable their animations. All my tests fails at AppCenter device farm.
@Oddj0b any update about this feature request?
We use this custom test rule to disable animations on App Center:
class AnimationsRule : TestRule {
private companion object {
const val PREFIX = "settings put global"
const val TRANSITION_ANIMATION = "transition_animation_scale"
const val WINDOW_ANIMATION = "window_animation_scale"
const val ANIMATOR_DURATION = "animator_duration_scale"
}
private val animations = listOf(TRANSITION_ANIMATION, WINDOW_ANIMATION, ANIMATOR_DURATION)
override fun apply(base: Statement, description: Description) =
object : Statement() {
override fun evaluate() {
disableAnimations()
try {
base.evaluate()
} finally {
enableAnimations()
}
}
}
private fun disableAnimations() = animations.forEach {
val command = "$PREFIX $it 0"
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
.executeShellCommand(command)
}
private fun enableAnimations() = animations.forEach {
val command = "$PREFIX $it 1"
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
.executeShellCommand(command)
}
}
System Animations are disabled on Android devices now.
Closed.
Thanks for the speedy resolution.
@peter-iglaev because of the disabled animations we started getting crashes on our Xamarin UI Tests when using Lottie animations in our app, is there anyway to force enable animations ?
thank you in advance
@Sergiu-Cosmin hello.
We are working on the feature to add customers' opportunities to enable system animations.
Follow the current issue for updates.
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.
Push
@peter-iglaev any news on this ?
Most helpful comment
@Sergiu-Cosmin hello.
We are working on the feature to add customers' opportunities to enable system animations.
Follow the current issue for updates.