add test result storing

This commit is contained in:
Niklas von Hertzen 2013-05-29 20:12:37 +03:00
parent 0d4b6ba665
commit 8c8128b80a
3 changed files with 31 additions and 1 deletions

View File

@ -6,6 +6,7 @@ env:
global:
- secure: "eW41gIqOizwO4pTgWnAAbW75AP7F+CK9qfSed/fSh4sJ9HWMIY1YRIaY8gjr+6jV/f7XVHcXuym6ZxgINYSkVKbF1JKxBJNLOXtSgNbVHSic58pYFvUjwxIBI9aPig9uux1+DbnpWqXFDTcACJSevQZE0xwmjdrSkDLgB0G34v8="
- secure: "Y2Av+Gd3z9uQEB36GwdOOuGka0hx0/HeitASEo59z934O8RxnmN9eNTXS7dDT3XtKtwxIyLTOEpS7qlRdWahH28hr/dS4xJj6ao58C+1xMcDs6NAPGmDxUlcJWpcGEsnjmXjQCc3fBioSTdpIBrK/gdvgpNh77UKG74Sk7Z+YGk="
- secure: "N7NyiiwdsVsKLomdkdeb1lUdSiN7+luks0V4Sh+foJp1RnBqM54B+0pZNiwotMuhTuwv0kjURCooKiyV3eaTleRthutGL9Gt8YiCaCq+biZaZXZnk0E3AQqg/ZzQLeZyreQpcMGsbCnwtywtjvTYB6aJA+ZFzEhq5LRF8tsDn2Y="
before_script:
- npm install -g grunt-cli
- curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash

View File

@ -1,6 +1,9 @@
html2canvas
===========
### Current build status ###
[![Build Status](https://travis-ci.org/niklasvh/html2canvas.png)](https://travis-ci.org/niklasvh/html2canvas)
#### JavaScript HTML renderer ####
This script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.

View File

@ -147,7 +147,33 @@
} catch(e) {}
console.log(colors.violet, "Writing", browser + ".json");
fs.writeFile(filename, JSON.stringify(results[browser]));
var date = new Date();
var result = JSON.stringify({
browser: browser,
results: results[browser],
timestamp: date.toISOString()
});
if (process.env.MONGOLAB_URL) {
var options = {
host: "api.mongolab.com",
port: 443,
path: process.env.MONGOLAB_URL,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': result.length
}
};
var post_req = http.request(options, function(res) {
});
post_req.write(result);
post_req.end();
}
fs.writeFile(filename, result);
});
}