In order to test with espresso test framework i forked github repository https://github.com/hussien89aa/AndroidTutorialForBeginners.
I have created two simple tests on application Alaram App under directory: /Alaram App/app/src/androidTest.
First of the scenarios is checking whether desired pop-up is displayed. It is confirmed by checking the text which should be displayed on pop-up. Second scenario checks if user is correctly navigated onto main activity view after closing pop-up with button "done". It verifies if text which should be located on Main Activity View is displayed.