Testing Mobile Web Applications








Fil Maj, Master Exploder, Adobe
@filmaj

Testing

Testing, cont.

Who cares?

Biggest embarassment as a programmer: regressions

Be disciplined at your craft: write a test for each bug

Run your tests after each change. This will prevent regressions.

Continuous Integration

CI automates the testing process. You get continuous feedback as your codebase evolves - in real-time

Testing Desktop

(and native mobile apps)

Established testing methods already in place.

  • Selenium for desktop web apps
  • Proprietary instrumentation for native mobile apps
  • Automation available

Testing Mobile Web

Not so easy.

  • "Rent" time from a device testing service
  • Little to no automation (usually simulator based)
  • Not much different from a monkey

Testing Hybrid Apps (PhoneGap/Cordova)

You get the worst of both worlds!

Introducing: medic

A distributed continuous integration testing system built for the mobile web

http://github.com/filmaj/medic

Mobile

Medic takes JavaScript test suites and deploys it to real mobile devices

Currently supports Android, iOS and BlackBerry 10

Web

Uses adapter(s) built on top of popular JavaScript testing frameworks to report results

Currently supports Jasmine BDD

Distributed

---> <---
  • Each medic is a CI machine with connected mobile devices
  • Each medic runs tests
  • Each medic sends test results to single CouchDB server that aggregates test results
  • Test results are displayed on a CI Dashboard

How PhoneGap Uses It

We run our HTML test suite (mobile-spec) with it

This makes sure the PhoneGap JavaScript API is working properly across a slew of devices after every commit

The medic Vision

A portable device testing lab! Clients have issues? No problem, have them install medic, send your configuration to them, and get back results.

DEMO

Thanks!

@filmaj

http://filmaj.ca

http://github.com/filmaj/medic