diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-11 06:51:02 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-11 06:51:02 +0400 |
commit | d53dba6fea8b7c709411ef0de6a46c6d346b9054 (patch) | |
tree | 27d8924ee56719974552f67ffdcc29865fd5fb8f /tests/lib | |
parent | 2568598fce3365c454542f3f0f7edc8d5c8e8fb9 (diff) |
Remove --use-github-expected option and use new --assume-artifacts option in screenshot testrunner so diffviewer output will be accurate when uploaded to artifacts server.
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/screenshot-testing/support/app.js | 4 | ||||
-rw-r--r-- | tests/lib/screenshot-testing/support/diff-viewer.js | 8 | ||||
-rw-r--r-- | tests/lib/screenshot-testing/support/path.js | 5 |
3 files changed, 13 insertions, 4 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js index eff60535e2..c1161a3397 100644 --- a/tests/lib/screenshot-testing/support/app.js +++ b/tests/lib/screenshot-testing/support/app.js @@ -52,8 +52,8 @@ Application.prototype.printHelpAndExit = function () { console.log(" --print-logs: Prints webpage logs even if tests succeed."); console.log(" --store-in-ui-tests-repo: Stores processed screenshots within the UI tests repository even if"); console.log(" the tests are in another plugin. For use with travis build."); - console.log(" --use-github-expected: Only show the github expected file links in diffviewer.html output."); - console.log(" For use with travis build."); + console.log(" --assume-artifacts: Assume the diffviewer and processed screenshots will be stored on the."); + console.log(" builds artifacts server. For use with travis build."); phantom.exit(0); }; diff --git a/tests/lib/screenshot-testing/support/diff-viewer.js b/tests/lib/screenshot-testing/support/diff-viewer.js index 9745958d43..fdf7d187be 100644 --- a/tests/lib/screenshot-testing/support/diff-viewer.js +++ b/tests/lib/screenshot-testing/support/diff-viewer.js @@ -71,7 +71,7 @@ DiffViewerGenerator.prototype.generate = function (callback) { + entry.name + '.png'; var expectedHtml = ''; - if (!options['use-github-expected']) { + if (!options['assume-artifacts']) { expectedHtml += '<a href="' + expectedUrl + '">Expected</a> '; } expectedHtml += '<a href="' + expectedUrlGithub + '">[Github]</a>'; @@ -80,7 +80,11 @@ DiffViewerGenerator.prototype.generate = function (callback) { } if (entry.processed) { - entry.processedUrl = self.getUrlForPath(entry.processed); + if (options['assume-artifacts']) { + entry.processedUrl = path.join("../processed-ui-screenshots", path.basename(entry.processed)); + } else { + entry.processedUrl = self.getUrlForPath(entry.processed); + } } var entryLocationHint = '', diff --git a/tests/lib/screenshot-testing/support/path.js b/tests/lib/screenshot-testing/support/path.js index 2d5e796f1d..bd202ed4b0 100644 --- a/tests/lib/screenshot-testing/support/path.js +++ b/tests/lib/screenshot-testing/support/path.js @@ -16,6 +16,11 @@ exports.dirname = function (path) { return lastSeparator == -1 ? path : path.substring(0, lastSeparator); }; +exports.basename = function (path) { + var lastSeparator = path.lastIndexOf("/"); + return lastSeparator == -1 ? path : path.substring(lastSeparator + 1); +}; + exports.resolve = function (path) { if (path.charAt(0) != '/') { path = exports.join(__dirname, path); |