Sean Blahovici
Sean Blahovici

Reputation: 5740

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?

Upvotes: 11

Views: 2271

Answers (2)

Grzegorz
Grzegorz

Reputation: 61

Latest regular version of espresso (3.5.0) has fixed this bug and currently, I don't have any other issues.

Upvotes: 5

João Graça
João Graça

Reputation: 415

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

Upvotes: 10

Related Questions