简体   繁体   中英

How to automatically test if offline mode is working in web application

I have mobile web application that has offline capabilities (via HTML5).

I'm currently building automatic build & testing for it (ant, JsTestDriver etc.), until I hit a wall. How can I test if the web application has working offline mode? This is specially painful since if tested by hand; iPhone practically needs full reset between tests (it tends to cling on to some parts of the data).

I'm thinking something around these lines (on a idea level):

  1. Setup Java web server with ant
  2. Fire some sort of headless client, that supports HTML5 offline use
  3. Load the application
  4. Validate that everything is loaded
  5. Disable server
  6. Load the application
  7. Validate that everything is loaded, still

Any suggestions how would I proceed doing something like this?

Not sure I understand your question, but what do you think of:

  1. Not using an iPhone, but chrome on PC with the ripple emulator http://ripple.tinyhippos.com/
  2. Setting a fake proxy or editing the .host file in order to be sure that your chrome session does not have access to your server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM