diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-03 12:34:09 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-03 12:34:09 +0400 |
commit | 6870068d5333abc66cf533431615f69f04ac18b4 (patch) | |
tree | 1bb1d03affce4666c3d7afc20af2f7500da0d8b0 /tests/lib | |
parent | 59ca7888bcfaf559e6be49d4e9ef842f4e338841 (diff) |
Debugging travis failures.
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/screenshot-testing/support/app.js | 4 | ||||
-rw-r--r-- | tests/lib/screenshot-testing/support/chai-extras.js | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js index f9b65a97c4..106cb176cf 100644 --- a/tests/lib/screenshot-testing/support/app.js +++ b/tests/lib/screenshot-testing/support/app.js @@ -103,15 +103,11 @@ Application.prototype.runTests = function () { // make sure all necessary directories exist (symlinks handled by PHP since phantomjs can't create any) var dirsToCreate = [ - config.expectedScreenshotsDir, - config.processedScreenshotsDir, - config.screenshotDiffDir, path.join(PIWIK_INCLUDE_PATH, 'tmp/sessions') ]; dirsToCreate.forEach(function (path) { if (!fs.isDirectory(path)) { - console.log("MAKING PATH: " + path); fs.makeTree(path); } }); diff --git a/tests/lib/screenshot-testing/support/chai-extras.js b/tests/lib/screenshot-testing/support/chai-extras.js index 694ed7b503..b5f4636a00 100644 --- a/tests/lib/screenshot-testing/support/chai-extras.js +++ b/tests/lib/screenshot-testing/support/chai-extras.js @@ -52,8 +52,22 @@ chai.Assertion.addChainableMethod('capture', function () { var screenshotFileName = screenName + '.png', dirsBase = app.runner.suite.baseDirectory, - expectedScreenshotPath = path.join(dirsBase, config.expectedScreenshotsDir, compareAgainst + '.png'), - processedScreenshotPath = path.join(dirsBase, config.processedScreenshotsDir, screenshotFileName); + + expectedScreenshotDir = path.join(dirsBase, config.expectedScreenshotsDir), + expectedScreenshotPath = path.join(expectedScreenshotDir, compareAgainst + '.png'), + + processedScreenshotDir = path.join(dirsBase, config.processedScreenshotsDir), + processedScreenshotPath = path.join(processedScreenshotDir, screenshotFileName), + + screenshotDiffDir = path.join(dirsBase, config.screenshotDiffDir); + + if (!fs.isDirectory(processedScreenshotDir)) { + fs.makeTree(processedScreenshotDir); + } + + if (!fs.isDirectory(screenshotDiffDir)) { + fs.makeTree(screenshotDiffDir); + } pageSetupFn(pageRenderer); |