Apps/testing
Contents
Testing Background
Currently, there are two ways of doing testing. The first are Jetpack based unit tests. These are used by the developers while adding to/modifying the Jetpack OWA addon.
Jetpack Unit Tests - Jetpack based Unit Tests
The second set of tests are Node.js/DoctypeJS based unit/integration tests for the HTML5 shim, which also act as integration tests for the OWA addon.
DoctypeJS/Node.js based unit tests - DoctypeJS/Node.js based unit tests.
Documents relating to testing
- How to get started Getting Started with Testing
- How to run MozMill tests MozMill testing
How To Run Tests
Software Requirements
- node.js
- OWA Github repository OWA Repository
- Jetpack Addon-SDK Jetpack Addon-SDK
- Mozmill MozMill
Building the XPI to test
The README.md file pointed at above, it explains how to set up the addon-sdk so that you can build the xpi to run the mozmill scripts. The general flow is:
- make sure you have the addon-sdk repo.
- cd to the repo directory (probably addon-sdk)
- type 'source bin/activate'
Running Mozmill Scripts
- cd to openwebapps_directory/site/tests/
- type 'node run.js'
- open a new window, do steps 1-3
- cd to openwebapps_directory/site/tests/mozmill/
- Run the tests! You can use test_addon.sh for testing the addon, and test_html5.sh for testing the html5 shim.
Note, the addon test right now is failing on two tests. We know this already and are trying to figure out whether to make the tests change, or whether the openwebapps addon has to change.
Use Cases
OWA Addon Installation
- Test in all supported release versions of Firefox
- Test against Aurora
- Test against Beta
- Test in unsupported versions of browser to make sure fail happens.
Installing an app - install
- Called from non-HTML5 browser without addon.
- User clicks "install", not already installed.
- User clicks "install", already installed (store diddn't know app already installed case)
- User cancels installation during payment phase
- User denies permission to install.
- Could not get manifest
- Could not get app
- Bad URL to manifest
- Bad content type
- Other network error
- Manifest syntax errors
- JSON Syntax Error
- Manifest with BOM
- Manifest semantic errors (missing fields)
- Missing data necessary for install? (is this possible?)
- Successful installation.
App host checking whether an app is installed - amInstalled
- Called from non-HTML5 browser without addon.
- Called from origin with no apps.
- Called from origin with apps.
Stores checking which apps it helped install - getInstalledBy
- Called from non-HTML5 browser without addon.
- No apps installed
- One or more apps installed.
launch - launch an application
- Called from non-HTML5 browser without addon.
- Launch with malformed URL to origin
- Launch, app not installed
- Launch with app installed, but user cancels.
- Launch with app installed, all good.
list - list all installed apps
- Called from non-HTML5 browser without addon.
- no apps installed
- one or more apps installed
uninstall - uninstall an app.
- Called from non-HTML5 browser without addon.
- Uninstall with malformed URL to origin
- Uninstall, app not installed
- Uninstall with app installed, but user cancel.
- Uninstall with app installed, all good.