Android Espresso, Wake up device before test. How to use a custom manifest for test?

前端 未结 8 1305
情书的邮戳
情书的邮戳 2020-12-09 03:52

I\'ve been writing tests with androids new espresso framework and find that it works well. One annoying thing (not particular to espresso) is that I have to make sure my scr

8条回答
  •  借酒劲吻你
    2020-12-09 04:14

    Now that KeyguardLock is deprecated, you can simply use:

        if (BuildConfig.DEBUG) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
        }
    

提交回复
热议问题