android / android/testing-samples

Espresso is not waiting for drawer to close

Open
#289 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.3k
Forks
3.6k
PR merge metrics
No merged PRs in 30d

Description

I am currently using androidx test espresso version 3.2.0.
After updating androidx's navigation version to 2.1.0, Espresso has become flaky when performing ViewActions.click() on page that was navigated to through a navigation drawer due to Espresso not waiting for the drawer to be closed before performing the action.
The test would:
1. Open the navigation drawer
2. Click on a menu item in drawer (We call close on the navigation drawer when an item is clicked)
4. Check DrawerMatchers.isClosed() on the drawer layout, which fails.

This was not an issue in navigation version 2.0.0, since I confirmed the tests did not fail if I reverted the version from 2.1.0 to 2.0.0.

Contributor guide

Open the contributing guide

Research direction

The issue does not name a file or test; start by locating the test that opens the navigation drawer, clicks a menu item, and checks DrawerMatchers.isClosed(). Reproduce it with AndroidX Navigation 2.1.0 and compare with 2.0.0; done means the drawer is closed when the check runs after the click.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.