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 <benaka@piwik.pro>2015-10-09 22:24:20 +0300
committerdiosmosis <benaka@piwik.pro>2015-10-09 22:24:20 +0300
commite53fb487299b93ed2b4d0f941e831ae430083657 (patch)
treef768675ee651dab73e8f385fd8448b99ea874acf /tests/lib
parentc5613e18a633b1c62edccf7c45ccc224fc26b24f (diff)
Record missing expected screenshots in UI tests in new missing-expected.list build artifact.
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/screenshot-testing/support/app.js9
-rw-r--r--tests/lib/screenshot-testing/support/chai-extras.js2
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js
index e0838b7025..95995797c2 100644
--- a/tests/lib/screenshot-testing/support/app.js
+++ b/tests/lib/screenshot-testing/support/app.js
@@ -42,8 +42,8 @@ var isCorePlugin = function (pathToPlugin) {
var Application = function () {
this.runner = null;
- var diffviewerDir = path.join(PIWIK_INCLUDE_PATH, 'tests/UI', config.screenshotDiffDir);
- this.diffViewerGenerator = new DiffViewerGenerator(diffviewerDir);
+ this.diffviewerDir = path.join(PIWIK_INCLUDE_PATH, 'tests/UI', config.screenshotDiffDir);
+ this.diffViewerGenerator = new DiffViewerGenerator(this.diffviewerDir);
};
Application.prototype.printHelpAndExit = function () {
@@ -259,4 +259,9 @@ Application.prototype.finish = function () {
phantom.exit(this.runner ? this.runner.failures : -1);
};
+Application.prototype.appendMissingExpected = function (screenName) {
+ var missingExpectedFilePath = path.join(this.diffviewerDir, 'missing-expected.list');
+ fs.write(missingExpectedFilePath, screenName + "\n", "a");
+};
+
exports.Application = new Application(); \ No newline at end of file
diff --git a/tests/lib/screenshot-testing/support/chai-extras.js b/tests/lib/screenshot-testing/support/chai-extras.js
index f07651053d..a43c8a07e3 100644
--- a/tests/lib/screenshot-testing/support/chai-extras.js
+++ b/tests/lib/screenshot-testing/support/chai-extras.js
@@ -137,6 +137,8 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh
}
if (!testInfo.expected) {
+ app.appendMissingExpected(screenName);
+
fail("No expected screenshot found for " + screenshotFileName + ".");
return;
}