Espresso ViewActions.swipeRight doesn't work for ViewPager2 on device with API 32+
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- mobile-dev, testing
Research direction
Start with the linked sample project's MainActivity and MainActivityTest, then reproduce ViewActions.swipeRight on ViewPager2 on API 31 and API 32+ devices. Compare the gesture behavior with swipeLeft and trace the relevant Espresso entry point. Done means swipeRight pages ViewPager2 instead of triggering back on API 32 and newer.
Written by the indexing model from the issue text.
Description
Description
As the title says, ViewActions.swipeRight doesn't work on devices with API >= 32 when called on ViewPager2.
Calling a swipeRight on a ViewPager2 triggers a back instead of a swiping on the ViewPager2 itself.
Steps to Reproduce
In the sample project linked below you can find a simple activity MainActivity with a ViewPager2, and a MainActivityTest.
The test just swipes on the view pager using Espresso ViewActions: swipeLeft/swipeRight.
Launching the test on a device with API <= 31 passes, but fails on devices with API 32 and above.
swipeLeft instead, works in any case.
Expected Results
Performing swiping actions on the view pager.
Demo on emulator device with API 31
https://github.com/android/android-test/assets/43886303/c1ffedd4-4b8d-42d7-9093-532f9a9f5655
Actual Results
Back press.
Demo on emulator device with API 32
https://github.com/android/android-test/assets/43886303/690e5456-5622-4ba3-82be-8170cdbb5e2a
AndroidX Test and Android OS Versions
- agp = "8.3.2"
- kotlin = "1.9.0"
- activity = "1.8.2"
- appcompat = "1.6.1"
- viewpager2 = "1.0.0"
- espressoCore = "3.5.1"
- testCore = "1.5.0"
- testJunit = "1.1.5"
Link to a public git repo demonstrating the problem:
https://github.com/alecarnevale/EspressoSwipeRightIssue/tree/master
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 342
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/android-test
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
android/android-test#681 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
android/android-test#2507 · 1 comment ·
-
ξεκσνδξδ Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2499 ·
-
ησξξσ Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2498 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
android/android-test#2473 ·
All issues in android/android-test
Similar issues
-
certification
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Openbug ecr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Needs: Triage Type: Feature request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2760 ·