简体   繁体   中英

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). 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.

For reference, this is the code in the 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. Everything works fine until testing on an API 33 emulator.

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.

I've bumped espresso version to the latest alpha version ( 3.5.0-alpha07 ) and seems like it fixed the issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM