testing-samples icon indicating copy to clipboard operation
testing-samples copied to clipboard

Espresso is not waiting for drawer to close

Open chklow opened this issue 6 years ago • 1 comments

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

chklow avatar Sep 30 '19 17:09 chklow

We currently experiencing a similar issue with Espresso 3.3.0. We are also using androidx.test.espresso:espresso-contrib:3.3.0. Test were running fine but after adding dependency androidx.fragment:fragment-ktx:1.3.5 the tests with the navigation drawer failed because Espresso is not waiting but immediately executing the next action.

aroyarexs avatar Jun 28 '21 09:06 aroyarexs