diff options
author | Matthieu Aubry <matt@piwik.org> | 2016-04-11 14:57:43 +0300 |
---|---|---|
committer | Matthieu Aubry <matt@piwik.org> | 2016-04-11 14:57:43 +0300 |
commit | fb323f68b8e22b44df306b69fc5a260b558f6951 (patch) | |
tree | 07c3523665525e8e9d66201037fab35050d59707 /tests | |
parent | 0055c39d4eb74e064a439ad35bba93c26ac42d46 (diff) | |
parent | 3c8540b3f76b880bdba00c5f08461f94226f8075 (diff) |
Merge pull request #10034 from piwik/fix_ui_build_bis
ui tests, set properly the `name` attribute to the full filename for diffviewer to work
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/screenshot-testing/support/chai-extras.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/lib/screenshot-testing/support/chai-extras.js b/tests/lib/screenshot-testing/support/chai-extras.js index 3cc80ef7c2..88ea06af70 100644 --- a/tests/lib/screenshot-testing/support/chai-extras.js +++ b/tests/lib/screenshot-testing/support/chai-extras.js @@ -114,8 +114,10 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh throw new Error("No 'done' callback specified in capture assertion."); } - var screenshotFileName = screenName, - expectedScreenshotPath = getExpectedFilePath(compareAgainst), + screenName = assumeFileIsImageIfNotSpecified(screenName); + compareAgainst = assumeFileIsImageIfNotSpecified(compareAgainst); + + var expectedScreenshotPath = getExpectedFilePath(compareAgainst), processedScreenshotPath = getProcessedFilePath(screenName), screenshotDiffDir = getScreenshotDiffDir(); @@ -155,14 +157,14 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh }; if (!testInfo.processed) { - fail("Failed to generate screenshot to " + screenshotFileName + "."); + fail("Failed to generate screenshot to " + screenName + "."); return; } if (!testInfo.expected) { app.appendMissingExpected(screenName); - fail("No expected screenshot found for " + screenshotFileName + "."); + fail("No expected screenshot found for " + screenName + "."); return; } @@ -203,7 +205,7 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh child.on("exit", function (code) { if (testFailure) { - testFailure = 'Processed screenshot does not match expected for ' + screenshotFileName + ' ' + testFailure; + testFailure = 'Processed screenshot does not match expected for ' + screenName + ' ' + testFailure; testFailure += 'TestEnvironment was ' + JSON.stringify(testEnvironment); } @@ -240,6 +242,8 @@ function compareContents(compareAgainst, pageSetupFn, done) { throw new Error("No 'done' callback specified in 'pageContents' assertion."); } + compareAgainst = assumeFileIsImageIfNotSpecified(compareAgainst); + var screenshotDiffDir = getScreenshotDiffDir(), processedFilePath = getProcessedFilePath(compareAgainst), expectedFilePath = getExpectedFilePath(compareAgainst); |