Skip to content
Extraits de code Groupes Projets
Valider 3c8540b3 rédigé par mattab's avatar mattab
Parcourir les fichiers

Set properly the `name` attribute to the full filename

parent bea3dcdf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -114,8 +114,10 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh ...@@ -114,8 +114,10 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh
throw new Error("No 'done' callback specified in capture assertion."); throw new Error("No 'done' callback specified in capture assertion.");
} }
var screenshotFileName = screenName, screenName = assumeFileIsImageIfNotSpecified(screenName);
expectedScreenshotPath = getExpectedFilePath(compareAgainst), compareAgainst = assumeFileIsImageIfNotSpecified(compareAgainst);
var expectedScreenshotPath = getExpectedFilePath(compareAgainst),
processedScreenshotPath = getProcessedFilePath(screenName), processedScreenshotPath = getProcessedFilePath(screenName),
screenshotDiffDir = getScreenshotDiffDir(); screenshotDiffDir = getScreenshotDiffDir();
...@@ -155,14 +157,14 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh ...@@ -155,14 +157,14 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh
}; };
if (!testInfo.processed) { if (!testInfo.processed) {
fail("Failed to generate screenshot to " + screenshotFileName + "."); fail("Failed to generate screenshot to " + screenName + ".");
return; return;
} }
if (!testInfo.expected) { if (!testInfo.expected) {
app.appendMissingExpected(screenName); app.appendMissingExpected(screenName);
fail("No expected screenshot found for " + screenshotFileName + "."); fail("No expected screenshot found for " + screenName + ".");
return; return;
} }
...@@ -203,7 +205,7 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh ...@@ -203,7 +205,7 @@ function capture(screenName, compareAgainst, selector, pageSetupFn, comparisonTh
child.on("exit", function (code) { child.on("exit", function (code) {
if (testFailure) { 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); testFailure += 'TestEnvironment was ' + JSON.stringify(testEnvironment);
} }
...@@ -240,6 +242,8 @@ function compareContents(compareAgainst, pageSetupFn, done) { ...@@ -240,6 +242,8 @@ function compareContents(compareAgainst, pageSetupFn, done) {
throw new Error("No 'done' callback specified in 'pageContents' assertion."); throw new Error("No 'done' callback specified in 'pageContents' assertion.");
} }
compareAgainst = assumeFileIsImageIfNotSpecified(compareAgainst);
var screenshotDiffDir = getScreenshotDiffDir(), var screenshotDiffDir = getScreenshotDiffDir(),
processedFilePath = getProcessedFilePath(compareAgainst), processedFilePath = getProcessedFilePath(compareAgainst),
expectedFilePath = getExpectedFilePath(compareAgainst); expectedFilePath = getExpectedFilePath(compareAgainst);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter