EDIT: Updated description and error message and added some images. Still have this problem.
I have a strange error that occur many times when running espresso tests. Af
You can wake up your device before every test using Uiautomator.
@Before
public void init(){
UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
Point[] coordinates = new Point[4];
coordinates[0] = new Point(248, 1520);
coordinates[1] = new Point(248, 929);
coordinates[2] = new Point(796, 1520);
coordinates[3] = new Point(796, 929);
try {
if (!uiDevice.isScreenOn()) {
uiDevice.wakeUp();
uiDevice.swipe(coordinates, 10);
}
} catch (RemoteException e) {
e.printStackTrace();
}
}