From cacb9a468fb5459167e723c6ac6dd31fbd2d2de7 Mon Sep 17 00:00:00 2001 From: Dan Farrelly Date: Sat, 23 Mar 2013 20:00:01 -0400 Subject: [PATCH] Modified markdown function. Added grunt build task. Markdown format output currently commented out. --- .DS_Store | Bin 0 -> 6148 bytes Gruntfile.js | 1 + tests/readme.md | 70 +++++++++++++++++++++++----------------------- tests/selenium.js | 55 ++++++++++++++++++++++++++++-------- 4 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0chrome
23.0.1271.97firefox
12.0iexplorer
9 -background/clip.html100%100%99.89% -background/encoded.html100%100%100% -background/linear-gradient.html89.87%90.73%100% -background/multi.html100%100%99.93% -background/position.html100%100%99.87% -background/radial-gradient.html73.23%70.32%94.02% -background/repeat.html100%100%99.92% -border/dashed.html96.45%98.38%97.7% -border/dotted.html97.41%96.46%95.93% -border/double.html97.96%97.87%97.95% -border/radius.html99.74%99.77%99.75% -border/solid.html99.97%99.97%99.98% -forms.html95.96%94.55%95.01% -images/canvas.html99.86%100%100% -images/cross-origin.html97.99%97.58%99.35% -images/empty.html99.86%99.87%99.85% -images/images.html83.72%96.93%55.09% -images/svg.html99.92%96.79%99.93% -list/decimal-leading-zero.html99.63%99.72%35.88% -list/decimal.html99.64%99.73%35.89% -list/lower-alpha.html99.65%99.73%35.89% -list/upper-roman.html99.45%99.61%35.94% -overflow.html96.85%97.49%96.5% -pseudoelements.html97.36%97.94%99.37% -text/chinese.html99.75%99.74%65.76% -text/linethrough.html97.14%94.12%47.08% -text/text.html95.71%94.67%85.01% -text/underline-lineheight.html97.06%92.35%53% -text/underline.html97.65%93.5%47.02% -visibility.html99.19%98.92%99.39% -zindex/z-index1.html96.99%99.27%99.44% -zindex/z-index2.html95.85%98.06%97.72% -zindex/z-index3.html98.6%98.29%98.56% - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + +b + + + + + + +
chrome
23.0.1271.97
firefox
12.0
iexplorer
9
chrome
25.0.1364.172
Mac 10.7.4
firefox
19.0.2
Mac 10.7.4
safari
6.0
Mac 10.7.4
background/clip.html100%100%99.89%100%100%100%
background/encoded.html100%100%100%100%100%100%
background/linear-gradient.html89.87%90.73%100%95.35%91.33%91.69%
background/multi.html100%100%99.93%100%100%100%
background/position.html100%100%99.87%100%100%100%
background/radial-gradient.html73.23%70.32%94.02%87.65%57.99%79.95%
background/repeat.html100%100%99.92%100%100%100%
border/dashed.html96.45%98.38%97.7%98.36%98.47%97.43%
border/dotted.html97.41%96.46%95.93%98.81%96.31%98.13%
border/double.html97.96%97.87%97.95%99.06%97.99%98.53%
border/radius.html99.74%99.77%99.75%99.88%99.81%99.75%
border/solid.html99.97%99.97%99.98%99.99%99.97%99.98%
forms.html95.96%94.55%95.01%98.57%94.2%97.69%
images/canvas.html99.86%100%100%99.93%100%99.87%
images/cross-origin.html97.99%97.58%99.35%99.7%98.41%99.89%
images/empty.html99.86%99.87%99.85%99.91%99.81%99.86%
images/images.html83.72%96.93%55.09%92.45%95.81%87.06%
images/svg.html99.92%96.79%99.93%99.95%96.51%99.92%
list/decimal-leading-zero.html99.63%99.72%35.88%99.7%99.99%15.05%
list/decimal.html99.64%99.73%35.89%99.71%99.99%15.06%
list/lower-alpha.html99.65%99.73%35.89%99.72%99.98%15.06%
list/upper-roman.html99.45%99.61%35.94%99.59%99.99%13.97%
overflow.html96.85%97.49%96.5%98.15%97.96%99.42%
pseudoelements.html97.36%97.94%99.37%98.73%97.81%98.29%
text/chinese.html99.75%99.74%65.76%93.93%96%46.75%
text/linethrough.html97.14%94.12%47.08%98.99%90.28%31.02%
text/text.html95.71%94.67%85.01%96.83%95.6%94.63%
text/underline-lineheight.html97.06%92.35%53%99.15%93.69%40.76%
text/underline.html97.65%93.5%47.02%99.35%89.85%31.07%
visibility.html99.19%98.92%99.39%99.69%99.32%99.74%
zindex/z-index1.html96.99%99.27%99.44%98.62%98.48%98%
zindex/z-index2.html95.85%98.06%97.72%97.79%96.69%96.72%
zindex/z-index3.html98.6%98.29%98.56%99.35%96.49%97.92%
diff --git a/tests/selenium.js b/tests/selenium.js index 8f7bc88..e8ad78e 100644 --- a/tests/selenium.js +++ b/tests/selenium.js @@ -99,7 +99,7 @@ } done(100 - (Math.round((diff/h2cPixels.length) * 10000) / 100)); }); - }) + }); }); }); }); @@ -247,26 +247,57 @@ }; exports.markdown = function() { - var data = {}, html = "", - browsers = ["chrome", "firefox", "iexplorer"]; + var data = {}, + html = "
", + md = " | ", + browsers = ["chrome", "firefox", "iexplorer", "safari"], + activeBrowsers = []; + // Create row for browsers browsers.forEach(function(browser) { - data[browser] = JSON.parse(fs.readFileSync("tests/results/" + browser + ".json")); - html += ""; - }); - html += "\n"; - Object.keys(data[browsers[0]].tests).forEach(function(testFile) { + if (fs.existsSync("tests/results/" + browser + ".json")) { + + var fileContents = fs.readFileSync("tests/results/" + browser + ".json"); + data[browser] = JSON.parse(fileContents); + + activeBrowsers.push(browser); + + html += ""; + md += browser + data[browser].version + " | "; + } else { + console.log("Browser report not found. ", browser + ".json"); + } + + }); + + html += "\n"; + md += "\n ----"; + for (var i = activeBrowsers.length - 1; i >= 0; i--) { + md += "|---- "; + } + md += "\n"; + + Object.keys(data[activeBrowsers[0]].tests).forEach(function(testFile) { + html += ""; - browsers.forEach(function(browser) { - html += ""; + md += testFile.substring(12); + activeBrowsers.forEach(function(activeBrowsers) { + html += ""; + md += " | " + Math.round(data[activeBrowsers].tests[testFile] * 100) / 100 + "%"; }); - html += "\n" + html += "\n"; + md += "\n"; }); html += "
" + browser + "
" + data[browser].version + "
" + browser + "
" + data[browser].version + "
" + testFile.substring(12) + "" + Math.round(data[browser].tests[testFile] * 100) / 100 + "%" + Math.round(data[activeBrowsers].tests[testFile] * 100) / 100 + "%
"; - fs.writeFileSync("tests/readme.md", html); + // if (isMarkdown){ + // fs.writeFileSync("tests/readme.md", md); + // } else { + fs.writeFileSync("tests/readme.md", html); + // } + }; })(); \ No newline at end of file