diff options
Diffstat (limited to 'tests/lib/screenshot-testing/support/app.js')
-rw-r--r-- | tests/lib/screenshot-testing/support/app.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js index 0aff28d6dc..1290ac4b81 100644 --- a/tests/lib/screenshot-testing/support/app.js +++ b/tests/lib/screenshot-testing/support/app.js @@ -236,7 +236,10 @@ Application.prototype.loadTestModules = function () { message += "\n" + indent + indent + "Url to reproduce: " + url + "\n"; if (message.indexOf('Generated screenshot') === -1) { - const failurePath = path.join(PIWIK_INCLUDE_PATH, 'tests/UI/processed-ui-screenshots', test.title.replace(/\s+/g, '_') + '_failure.png'); + if (!fs.existsSync(path.join(PIWIK_INCLUDE_PATH, 'tests/UI/processed-ui-screenshots'))) { + fsExtra.mkdirsSync(path.join(PIWIK_INCLUDE_PATH, 'tests/UI/processed-ui-screenshots')); + } + const failurePath = path.join(PIWIK_INCLUDE_PATH, 'tests/UI/processed-ui-screenshots', test.title.replace(/(\s|[^a-zA-Z0-9_])+/g, '_') + '_failure.png'); message += indent + indent + "Screenshot of failure: " + failurePath + "\n"; |