cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/2] git commit: added status box and documentation to manual tests
Date Tue, 19 Aug 2014 00:56:39 GMT
Repository: cordova-plugin-device
Updated Branches:
  refs/heads/master ae3f2ed88 -> f09171bd5


added status box and documentation to manual tests


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

Branch: refs/heads/master
Commit: f94f1d4e86d546f81c95ac478123e15c140f46c9
Parents: f62e825
Author: Edna Morales <ednamorales@ednas-mbp-2.raleigh.ibm.com>
Authored: Thu Jul 24 15:09:29 2014 -0400
Committer: Edna Morales <ednamorales@ednas-mbp-2.raleigh.ibm.com>
Committed: Thu Jul 24 15:09:29 2014 -0400

----------------------------------------------------------------------
 tests/tests.js | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/f94f1d4e/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index e22b7c1..f7c30ef 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -66,7 +66,29 @@ exports.defineAutoTests = function() {
 };
 
 exports.defineManualTests = function(contentEl, createActionButton) {
-  createActionButton('Dump device', function() {
-    console.log(JSON.stringify(window.device, null, '\t'));
-  });
+  var logMessage = function (message, color) {
+        var log = document.getElementById('info');
+        var logLine = document.createElement('div');
+        if (color) {
+            logLine.style.color = color;
+        }
+        logLine.innerHTML = message;
+        log.appendChild(logLine);
+    }
+
+    var clearLog = function () {
+        var log = document.getElementById('info');
+        log.innerHTML = '';
+    }
+
+    var device_tests = '<h3>Press Dump Device button to get device information</h3>'
+
+        '<div id="dump_device"></div>' +
+        'Expected result: Status box will get updated with device info. (i.e. platform, version,
uuid, model, etc)';
+
+    contentEl.innerHTML = '<div id="info"></div>' + device_tests;
+
+    createActionButton('Dump device', function() {
+      clearLog();
+      logMessage(JSON.stringify(window.device, null, '\t'));
+    }, "dump_device");
 };


Mime
View raw message