如何避免在espresso android Testing中某些不稳定的测试失败?

问题描述 投票:0回答:1

在我的测试套件中,至少有10个测试,每次至少有2个测试失败,但是仅运行该方法就不会失败。如何处理此类问题

到目前为止,我正在使用Thread.sleep来避免更多的失败。如何做显式等待

android android-espresso ui-automation
1个回答
0
投票

禁用动画将有助于最大程度地减少片状故障。

要从Mac终端禁用动画

adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0

进一步提供适当的睡眠时间和断言

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.