简体   繁体   English

Espresso swipeUp()、swipeDown() 等。不再适用于 API 33+ (Android 13)

[英]Espresso swipeUp(), swipeDown() etc. No longer working on API 33+ (Android 13)

So I am running instrumented tests with my app targeting API 33 (Android 13).因此,我正在使用我的应用程序针对 API 33 (Android 13) 运行仪器测试。 I noticed some tests were failing due to the espresso swipe functions not doing their job.我注意到一些测试失败是因为浓缩咖啡刷卡功能没有发挥作用。

onView(withId(android.R.id.content)).perform(swipeUp())

The test does not fail on this call, but later because my test depends on the action to evaluate the UI.这次调用测试没有失败,但后来因为我的测试依赖于评估 UI 的操作。

For reference, this is the code in the Espresso swipeUp function:作为参考,这是 Espresso swipeUp function 中的代码:

public static ViewAction swipeUp() {
return actionWithAssertions(
    new GeneralSwipeAction(
        Swipe.FAST,
        GeneralLocation.translate(GeneralLocation.BOTTOM_CENTER, 0, -EDGE_FUZZ_FACTOR),
        GeneralLocation.TOP_CENTER,
        Press.FINGER));

} }

I am using Espresso 3.3.0.我正在使用 Espresso 3.3.0。 Everything works fine until testing on an API 33 emulator.一切正常,直到在 API 33 模拟器上进行测试。

Has anyone else had this problem, and if not is there a workaround?有没有其他人遇到过这个问题,如果没有,是否有解决方法?

Latest regular version of espresso (3.5.0) has fixed this bug and currently, I don't have any other issues.最新的普通版 espresso (3.5.0) 已经修复了这个错误,目前,我没有任何其他问题。

I've bumped espresso version to the latest alpha version ( 3.5.0-alpha07 ) and seems like it fixed the issue我已经将 espresso 版本升级到最新的 alpha 版本( 3.5.0-alpha07 ),似乎它解决了这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 精细媒体权限 Android 13 API 33 - Granular media permissions Android 13 API 33 Android Espresso 测试 SwipeRefreshLayout OnRefresh 未在 swipeDown 上触发 - Android Espresso testing SwipeRefreshLayout OnRefresh not been triggered on swipeDown Angular2,HammerJs,swipeup无法与android一起使用 - Angular2, HammerJs, swipeup not working with android 如何使用 Android Espresso 测试 TextInputLayout 值(提示、错误等)? - How to test TextInputLayout values (hint, error, etc.) using Android Espresso? 在android中使用视频(裁剪,叠加等) - 怎么样? - Working with video in android (crop, overlay, etc.) - how? Android Espresso - 在 swipeUp 到列表结尾后单击带有特定字符串的第一个 RecyclerView 项目 - Android Espresso - Clicking on the first RecyclerView Item with a certain string after swipeUp to ending of list 定位 sdk 版本 33(Android 13)是否安全? - Is it safe to target sdk version 33 (Android 13)? GestureDetector.OnGestureListener 覆盖的方法在 Android API 33 中不起作用 - GestureDetector.OnGestureListener overridden methods are not working in Android API 33 Android API 33个权限未授予 - Android API 33 permissions are not granted Play 商店警告:您必须先完成广告 ID 声明,然后才能发布针对 Android 13 (API 33) 的应用 - Play Store warning: You must complete the advertising ID declaration before you can release an app that targets Android 13 (API 33)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM