Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authordiosmosis <benakamoorthi@fastmail.fm>2014-03-11 21:41:04 +0400
committerdiosmosis <benakamoorthi@fastmail.fm>2014-03-11 21:41:04 +0400
commit121d60691ddb1219bf237eb292c103e30f12b7df (patch)
tree1544eb4969f57094c0e787edcc202c2ff6f8d5c0 /tests/lib
parentf24b2235eab57726a17777d260d81d7eb36d2459 (diff)
Fixing diffviewer generation for plugins.
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/screenshot-testing/support/app.js2
-rw-r--r--tests/lib/screenshot-testing/support/chai-extras.js2
-rw-r--r--tests/lib/screenshot-testing/support/diff-viewer.js5
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 = '';