cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cordova Wiki] Update of "RunningTests" by JoshSoref
Date Thu, 07 Nov 2013 12:50:54 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cordova Wiki" for change notification.

The "RunningTests" page has been changed by JoshSoref:
https://wiki.apache.org/cordova/RunningTests?action=diff&rev1=18&rev2=19

Comment:
Wikify page

  There are two parts to the Mobile Spec:
  
   1. a suite of Jasmine tests that assert things about the Cordova JavaScript API. When you
load mobile-spec up on your device, hit the "Automatic Tests" button, and select which specific
API to test (or select "all" to run them all).
-  2. a series of "manual" tests. These are all linked from the project's root page. You should
run through each one to make sure baseline functionality works as expected. The section below
spells out the details of what should be done and the expected behaviour.
+  1. a series of "manual" tests. These are all linked from the project's root page. You should
run through each one to make sure baseline functionality works as expected. The section below
spells out the details of what should be done and the expected behaviour.
  
  === Whitelist Exceptions Needed ===
  
   1. File Transfer Tests - '''ajax.googleapis.com'''
-  2. Media Tests - '''audio.ibeat.org'''
+  1. Media Tests - '''audio.ibeat.org'''
  
  === Testing Procedure ===
  
-  1. As a baseline, run the Jasmine Mobile Spec tests and note the number of tests passing/failing.
Use this a baseline when comparing changes you make. Not all platforms pass all of the tests
100%, but less than 50 failing tests is an acceptable number.
+  1. As a baseline, run the Jasmine Mobile Spec tests and note the number of tests passing/failing.
+   * Use this a baseline when comparing changes you make. Not all platforms pass all of the
tests 100%.
+   * More than ''50 failing tests'' is generally '''not''' acceptable.
-  2. Make changes to either the cordova-js code or the native code.
+  1. Make changes to either the cordova-js code or the native code.
-  3. Rebuild Cordova and/or the JavaScript and re-run the mobile-spec tests.
+  1. Rebuild Cordova and/or the JavaScript and re-run the mobile-spec tests.
-  4. Compare the number of failing tests.
+  1. Compare the number of failing tests.
-  5. Rinse and repeat until you get the same (or possibly even less!) number of tests failing.
+  1. Rinse and repeat until the number of failing tests is not more than before your change.
  
  == Running Unit Test ==
  
@@ -62, +64 @@

  
  When you load up mobile-spec, you will see a series of buttons. Each one of these (except
for the "Automatic Tests" button) will load a separate page encapsulating manual tests for
the various APIs. The below list lays out the expectations for each manual test page.
  
-  1. Test the Accelerometer. Make sure you can get the current acceleration, watch the acceleration,
and can stop the watch.
-  2. Test the Audio. Make sure your application has http://audio.ibeat.org added to the whitelist!
Make sure you can play, pause and stop audio playing (should be a little guitar riff). Make
sure you can record audio, and play/pause/stop that functionality as well.
-  3. Test the Battery. Load the page up, click "Add batterystatus listener" and plug it into
a connected USB cable or wall charger. You should see the actual level of the battery show
up in the box (if supported on your platform) as well as the plugged in label reading "true".
-  4. Test the Camera. You should be able to take a picture and have it show up on the test
page, as well as selecting a picture from the library (if supported on your platform) and
have that picture show up on the test page as well.
-  5. Test the Compass. Make sure you can get the current heading, watch the heading, and
can stop the watch.
-  6. Test the Contacts. You should be able to pull the entire contact list from your phone
into the box on the page (this can take a while depending on how many contacts you have on
your device). You should also be able to create a new contact. Verify this with the built-in
Contact viewing app your device comes with.
-  7. Test the Events. Load the page and, in turn, click each event to intercept, run the
device through the motions to fire that event, go back to the app and make sure the event
is listed in the box, stop intercepting that event, run the device through the motions of
that event again, and finally go back to the app and make sure that the event does not get
printed into the output box twice (to test for unregistration).
+  1. Test '''Accelerometer'''. Make sure you can:
+   * get the current acceleration
+   * watch the acceleration
+   * stop the watch
+  1. Test '''Audio'''.
+   * Make sure your application has http://audio.ibeat.org added to the whitelist!
+   * Make sure you can:
+    * play
+    * pause
+    * stop audio playing (should be a little guitar riff).
+   * Make sure you can:
+    * record audio
+    * play/pause/stop that functionality as well
+  1. Test '''Battery'''.
+   1. Load the page up,
+   1. click "Add batterystatus listener"
+   1. plug it into a connected USB cable or wall charger.
+    * You should see the actual level of the battery show up in the box (if supported on
your platform) as well as the plugged in label reading "true".
+  1. Test '''Camera'''. You should be able to:
+    * take a picture and have it show up on the test page,
+    * select a picture from the library (if supported on your platform) and have that picture
show up on the test page as well.
+  1. Test '''Compass'''. Make sure you can:
+    * get the current heading
+    * watch the heading
+    * can stop the watch
+  1. Test '''Contacts'''. You should be able to:
+    * pull the entire contact list from your phone into the box on the page (this can take
a while depending on how many contacts you have on your device).
+    * create a new contact.
+      * Verify this with the built-in Contact viewing app your device comes with.
+  1. Test '''Events'''.
+   * Steps:
+    1. Load the page
+    1. in turn, click each event to intercept,
+    1. run the device through the motions to fire that event,
+    1. go back to the app and make sure the event is listed in the box,
+    1. stop intercepting that event,
+    1. run the device through the motions of that event again,
+    1. finally go back to the app and make sure that the event does not get printed into
the output box twice (to test for unregistration).
+   * Events:
     * offline/online - remove/add SIM card and/or turn off/on WiFi and/or go into/out of
Airplane mode
     * pause/resume - press the Home button when a multi-tasking app is running, launch it
back again
     * resign/active - lock/unlock the iOS device
     * different buttons - only if supported on your platform
-  8. Test the Location. Make sure you can get the current location, watch the location, and
can stop the watch.
+  1. Test '''Location'''. Make sure you can:
+    * get the current location
+    * watch the location
+    * stop the watch
+  1. Test '''Network'''. When you load this page up, make sure that:
-  9. Test the Network. When you load this page up, make sure that the network state box prints
out the proper type of network connection your device is running under currently.
+    * the network state box prints out the proper type of network connection your device
is running under currently.
-  10. Test the Notifications. Make sure you can beep, vibrate, show a native alert and show
a native confirm dialog.
+  1. Test '''Notifications'''. Make sure you can:
+    * beep
+    * vibrate
+    * show a native alert
+    * show a native confirm dialog
  
  === Platform-specific manual tests ===
  
@@ -85, +127 @@

  
  === Tips using jasmine-node ===
  
- 1. Use "npm test" this calls > package.json "scripts": { "test": "jasmine-node --color
spec"}
+  1. Use `npm test` this calls > package.json "scripts": { "test": "jasmine-node --color
spec"}
- Remember when using npm jasmine-node binary is added to the $PATH temporarily
+   * Remember when using `npm` that `jasmine-node` binary is added to the `$PATH` temporarily
+  1. If something breaks ('''red F'''), then run verbose: `./node_modules/jasmine-node/bin/jasmine-node
 spec --verbose`
+   * Very useful to pin point spec.js that has the failing test, then do step 3
+  1. To run a single spec.js use `./node_modules/jasmine-node/bin/jasmine-node spec/run.spec.js
--verbose`
+   * Much faster iteration, code & test. But remember to run full suite before pushing
code
+  1. Don't run global `jasmine-node`, it might be a different version than the one in `cordova-cli/plugman`
/ `package.json`
  
- 2. If something breaks "red F", then run verbose. "./node_modules/jasmine-node/bin/jasmine-node
 spec --verbose"
- Very useful to pin point spec.js that has the failing test, then do step 3
- 
- 3. To run a single spec.js use "./node_modules/jasmine-node/bin/jasmine-node spec/run.spec.js
--verbose"
- Much faster iteration, code & test. But remember to run full suite before pushing code
- 
- 4. Don't run global "jasmine-node", it might be a different version than the one in cordoval-cli/plugman
package.json
- 

Mime
View raw message