Posts

Showing posts from February, 2016

Espresso & Progress bar Dialog: The epic conflict

If you are trying to test your app that has a ProgressDialog in it, STOP RIGHT THERE! You are gonna be in a world of pain, when your tests keep failing for no apparent reason after failing to find the progressDialog that is vividly visible on the screen. The problem isn't in your code. It's the shortcoming of the Espresso Testing Framework. The framework can't really handle the animations of the progress dialog. I am still digging around the exact reason, however from the little bit of research I have figured out that the drawable animation of the circle gives the impression of non idle state to the Espresso framework. So what does it mean? It means Espresso keeps waiting for the app to enter the idle state and as long as the progress dialog is visible on the screen, the app stays in the busy state. By the time animation ends, the progress dialog is gone. When the app enters the idle state and espresso comes out of the waiting loop to start running tests, it fails toex

Accessing Javascript/Jquery script files on the disk in your browser

All the modern browsers have implemented a security protocol that prevents the website to access files from the disk. It's a really important security measure that forbids the websites to snoop into your disk and steal your 'data'. However sometimes you want to load the files anyway. May you are developing a web app and you want to load libraries stored on your disk. This security protocol will hinder this action. You can use work arounds by setting certain flags of the browser that will disable these security fences but the catch is you will become vulnerable to the attacks. I don't advice disabling security in your browser. The workaround that I have found is very secure. So for example if you want to reference a Jquery file on your disk, trying to access it with src="file:///path/to/your/file.js" wont work. So the easiest workaround that doesn't require alot of effort is to serve these library files or any other file that you want to load by