cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/3] git commit: add documentation for manual tests
Date Tue, 19 Aug 2014 00:51:33 GMT
add documentation for manual tests


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/f2eebeed
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/f2eebeed
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/f2eebeed

Branch: refs/heads/master
Commit: f2eebeed0a06fa1a86402d9dc3798a877b3e7fcd
Parents: 45a50c4
Author: Edna Morales <ednamorales@ednas-mbp-2.raleigh.ibm.com>
Authored: Wed Jul 30 13:54:58 2014 -0400
Committer: Edna Morales <ednamorales@ednas-mbp-2.raleigh.ibm.com>
Committed: Wed Jul 30 13:54:58 2014 -0400

----------------------------------------------------------------------
 test/tests.js | 51 ++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 40 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/f2eebeed/test/tests.js
----------------------------------------------------------------------
diff --git a/test/tests.js b/test/tests.js
index 4f36dd1..3388da8 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -392,15 +392,44 @@ exports.defineManualTests = function (contentEl, createActionButton)
{
             createOptionsEl('cameraDirection', Camera.Direction) +
             '</div>',
         getpicture_div = '<div id="getpicture"></div>',
+        test_procedure = '<h4>Recommended Test Procedure</h4>' +
+            'Options not specified should be the default value' +
+            '<br>Status box should update with image and info whenever an image is
taken or selected from library' +
+            '</p><div style="background:#B0C4DE;border:1px solid #FFA07A;margin:15px
6px 0px;min-width:295px;max-width:97%;padding:4px 0px 2px 10px;min-height:160px;max-height:200px;overflow:auto">'
+
+            '<ol> <li>All default options. Should be able to edit once picture
is taken and will be saved to library.</li>' +
+            '</p><li>sourceType=PHOTOLIBRARY<br>Should be able to see picture
that was just taken in previous test and edit when selected</li>' +
+            '</p><li>sourceType=Camera<br>allowEdit=false<br>saveToPhotoAlbum=false<br>Should
not be able to edit when taken and will not save to library</li>' +
+            '</p><li>encodingType=PNG<br>allowEdit=true<br>saveToPhotoAlbum=true<br>cameraDirection=FRONT<br>Should
bring up front camera. Verify in status box info URL that image is encoded as PNG.</li>'
+
+            '</p><li>sourceType=SAVEDPHOTOALBUM<br>mediaType=VIDEO<br>Should
only be able to select a video</li>' +
+            '</p><li>sourceType=SAVEDPHOTOALBUM<br>mediaType=PICTURE<br>allowEdit=false<br>Should
only be able to select a picture and not edit</li>' +
+            '</p><li>sourceType=PHOTOLIBRARY<br>mediaType=ALLMEDIA<br>allowEdit=true<br>Should
be able to select pics and videos and edit picture if selected</li>' +
+            '</p><li>sourceType=CAMERA<br>targetWidth & targetHeight=50<br>allowEdit=false<br>Do
Get File Metadata test below and take note of size<br>Repeat test but with width and
height=800. Size should be significantly larger.</li>' +
+            '</p><li>quality=0<br>targetWidth & targetHeight=default<br>allowEdit=false<br>Do
Get File Metadata test below and take note of size<br>Repeat test but with quality=80.
Size should be significantly larger.</li>' +
+            '</ol></div>',
         inputs_div = '<h2>Native File Inputs</h2>' +
-            '<div>input type=file <input type="file" class="testInputTag"></div>'
+
+            'For the following tests, status box should update with file selected' +
+            '</p><div>input type=file <input type="file" class="testInputTag"></div>'
+
             '<div>capture=camera <input type="file" accept="image/*;capture=camera"
class="testInputTag"></div>' +
             '<div>capture=camcorder <input type="file" accept="video/*;capture=camcorder"
class="testInputTag"></div>' +
             '<div>capture=microphone <input type="file" accept="audio/*;capture=microphone"
class="testInputTag"></div>',
         actions_div = '<h2>Actions</h2>' +
-            '<div id="actions"></div>';
-
-    contentEl.innerHTML = info_div + options_div + getpicture_div + inputs_div + actions_div;
+            'For the following tests, ensure that an image is set in status box' +
+            '</p><div id="metadata"></div>' +
+            'Expected result: Get metadata about file selected.<br>Status box will
show, along with the metadata, "Call to FileEntry.getMetadata success, Call to FileEntry.setMetadata
success, Call to FileEntry.getParent success"' +
+            '</p><div id="reader"></div>' +
+            'Expected result: Read contents of file.<br>Status box will show "Got file:
{some metadata}, FileReader.readAsDataURL() - length = someNumber"' +
+            '</p><div id="copy"></div>' +
+            'Expected result: Copy image to new location and move file to different location.<br>Status
box will show "Call to FileEntry.copyTo success:{some metadata}, Call to FileEntry.moveTo
success:{some metadata}"' +
+            '</p><div id="write"></div>' +
+            'Expected result: Write image to library.<br>Status box will show "Call
to FileWriter.write success:{some metadata}, Call to FileWriter.truncate success:{some metadata}"'
+
+            '</p><div id="upload"></div>' +
+            'Expected result: Upload image to server.<br>Status box may print out progress.
Once finished will show "upload complete"' +
+            '</p><div id="draw_canvas"></div>' +
+            'Expected result: Display image using canvas.<br>Image will be displayed
in status box under "canvas:"' +
+            '</p><div id="remove"></div>' +
+            'Expected result: Remove image from library.<br>Status box will show "FileEntry.remove
success:["OK"]';
+
+    contentEl.innerHTML = info_div + options_div + getpicture_div + test_procedure + inputs_div
+ actions_div;
     var elements = document.getElementsByClassName("testInputTag");
     var listener = function (e) {
         testInputTag(e.target);
@@ -420,29 +449,29 @@ exports.defineManualTests = function (contentEl, createActionButton)
{
 
     createActionButton('Get File Metadata', function () {
         getFileInfo();
-    }, 'actions');
+    }, 'metadata');
 
     createActionButton('Read with FileReader', function () {
         readFile();
-    }, 'actions');
+    }, 'reader');
 
     createActionButton('Copy Image', function () {
         copyImage();
-    }, 'actions');
+    }, 'copy');
 
     createActionButton('Write Image', function () {
         writeImage();
-    }, 'actions');
+    }, 'write');
 
     createActionButton('Upload Image', function () {
         uploadImage();
-    }, 'actions');
+    }, 'upload');
 
     createActionButton('Draw Using Canvas', function () {
         displayImageUsingCanvas();
-    }, 'actions');
+    }, 'draw_canvas');
 
     createActionButton('Remove Image', function () {
         removeImage();
-    }, 'actions');
+    }, 'remove');
 };


Mime
View raw message