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
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2016-04-11 07:15:50 +0300
committermattab <matthieu.aubry@gmail.com>2016-04-11 07:15:50 +0300
commit26a0d71892d2fabdf52eab7dd8d5584eada9cc73 (patch)
treeb769305332040fed34d84d8c9e94d7136fad3e84 /tests
parentc74aa5f0f3ede94bd401e30c9892d2b85f282a2a (diff)
Handle PNG files similar to other filetypes
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/screenshot-testing/support/chai-extras.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/lib/screenshot-testing/support/chai-extras.js b/tests/lib/screenshot-testing/support/chai-extras.js
index 36fbed3df7..a654e1843e 100644
--- a/tests/lib/screenshot-testing/support/chai-extras.js
+++ b/tests/lib/screenshot-testing/support/chai-extras.js
@@ -56,9 +56,6 @@ function getProcessedFilePath(fileName) {
return path.join(processedScreenshotDir, fileName);
}
-function getProcessedScreenshotPath(screenName) {
- return getProcessedFilePath(screenName + '.png');
-}
function failCapture(fileTypeString, testInfo, expectedFilePath, processedFilePath, message, done) {
@@ -91,13 +88,13 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh
throw new Error("No 'done' callback specified in capture assertion.");
}
- var screenshotFileName = screenName + '.png',
+ var screenshotFileName = screenName,
dirsBase = app.runner.suite.baseDirectory,
expectedScreenshotDir = path.join(dirsBase, config.expectedScreenshotsDir),
- expectedScreenshotPath = path.join(expectedScreenshotDir, compareAgainst + '.png'),
+ expectedScreenshotPath = path.join(expectedScreenshotDir, compareAgainst),
- processedScreenshotPath = getProcessedScreenshotPath(screenName);
+ processedScreenshotPath = getProcessedFilePath(screenName);
screenshotDiffDir = path.join(options['store-in-ui-tests-repo'] ? uiTestsDir : dirsBase, config.screenshotDiffDir);
@@ -354,7 +351,7 @@ chai.Assertion.addChainableMethod('contains', function () {
throw new Error("No 'done' callback specified in 'contains' assertion.");
}
- var capturePath = screenName ? getProcessedScreenshotPath(screenName) : null;
+ var capturePath = screenName ? getProcessedFilePath(screenName) : null;
pageRenderer.capture(capturePath, function (err) {
var indent = " ";