diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-11 21:41:04 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-11 21:41:04 +0400 |
commit | 121d60691ddb1219bf237eb292c103e30f12b7df (patch) | |
tree | 1544eb4969f57094c0e787edcc202c2ff6f8d5c0 /tests/lib | |
parent | f24b2235eab57726a17777d260d81d7eb36d2459 (diff) |
Fixing diffviewer generation for plugins.
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/screenshot-testing/support/app.js | 2 | ||||
-rw-r--r-- | tests/lib/screenshot-testing/support/chai-extras.js | 2 | ||||
-rw-r--r-- | tests/lib/screenshot-testing/support/diff-viewer.js | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js index d99a3fa7db..ee9ad30314 100644 --- a/tests/lib/screenshot-testing/support/app.js +++ b/tests/lib/screenshot-testing/support/app.js @@ -54,6 +54,8 @@ Application.prototype.printHelpAndExit = function () { console.log(" the tests are in another plugin. 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."); + console.log(" --screenshot-repo: Specifies the github repository that contains the expected screenshots"); + console.log(" to link to in the diffviewer. For use with travis build."); phantom.exit(0); }; diff --git a/tests/lib/screenshot-testing/support/chai-extras.js b/tests/lib/screenshot-testing/support/chai-extras.js index 92504efcf1..b18a4f9d0b 100644 --- a/tests/lib/screenshot-testing/support/chai-extras.js +++ b/tests/lib/screenshot-testing/support/chai-extras.js @@ -59,7 +59,7 @@ chai.Assertion.addChainableMethod('capture', function () { processedScreenshotDir = path.join(options['store-in-ui-tests-repo'] ? uiTestsDir : dirsBase, config.processedScreenshotsDir), processedScreenshotPath = path.join(processedScreenshotDir, screenshotFileName), - screenshotDiffDir = path.join(dirsBase, config.screenshotDiffDir); + screenshotDiffDir = path.join(options['store-in-ui-tests-repo'] ? uiTestsDir : dirsBase, config.screenshotDiffDir); if (!fs.isDirectory(processedScreenshotDir)) { fs.makeTree(processedScreenshotDir); diff --git a/tests/lib/screenshot-testing/support/diff-viewer.js b/tests/lib/screenshot-testing/support/diff-viewer.js index fdf7d187be..58efe9dcfe 100644 --- a/tests/lib/screenshot-testing/support/diff-viewer.js +++ b/tests/lib/screenshot-testing/support/diff-viewer.js @@ -66,8 +66,9 @@ DiffViewerGenerator.prototype.generate = function (callback) { var entry = self.failures[i]; if (entry.expected) { - var expectedUrl = self.getUrlForPath(entry.expected); - var expectedUrlGithub = 'https://raw.github.com/piwik/piwik-ui-tests/master/expected-ui-screenshots/' + var expectedUrl = self.getUrlForPath(entry.expected), + screenshotRepo = options['screenshot-repo'] || 'piwik/piwik-ui-tests', + expectedUrlGithub = 'https://raw.github.com/' + screenshotRepo + '/master/expected-ui-screenshots/' + entry.name + '.png'; var expectedHtml = ''; |