You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/09/05 19:55:02 UTC
[2/4] git commit: added status box and documentation to manual tests
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/c64aac01
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/tree/c64aac01
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/diff/c64aac01
Branch: refs/heads/master
Commit: c64aac01458bdbd7ef26464e8fc3653185076080
Parents: 6ce0fdf
Author: Edna Morales <ed...@ednas-mbp-2.raleigh.ibm.com>
Authored: Thu Jul 24 15:09:29 2014 -0400
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 10:54:20 2014 -0700
----------------------------------------------------------------------
tests/tests.js | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/c64aac01/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");
};