Espresso intent test failing

前端 未结 4 762
日久生厌
日久生厌 2021-02-01 15:46

I\'m learning android instrumentation testing with espresso. I have an app which has a drawer menu and there is a menu called About. I was testing click on that menu item and co

4条回答
  •  清歌不尽
    2021-02-01 16:12

    If you are using a custom ActivityTestRule, you can add the proper Intents.init(), Intents.release() calls:

    @Override
    protected void afterActivityLaunched() {
        Intents.init();
        super.afterActivityLaunched();
    }
    
    @Override
    protected void afterActivityFinished() {
        super.afterActivityFinished();
        Intents.release();
    }
    

提交回复
热议问题