I am trying to write an automated test to an android application that appears when you unlock your screen using the espresso framework. I would like to add a test case to ensure that an activity appears when the screen is unlocked.
How can I programmatically lock or unlock the screen using espresso?