mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
autofix all violations
This commit is contained in:
parent
a07fa9f81d
commit
c2c12539b8
4245 changed files with 87854 additions and 83023 deletions
|
@ -49,9 +49,13 @@ async function buildGallery(comparisons) {
|
|||
const asyncBranch = promisify(simpleGit.branch, simpleGit);
|
||||
const branch = await asyncBranch();
|
||||
|
||||
const template = Handlebars.compile(await readFileAsync(
|
||||
path.resolve('./utilities/templates/visual_regression_gallery.handlebars')
|
||||
, 'utf8'), { knownHelpersOnly: true });
|
||||
const template = Handlebars.compile(
|
||||
await readFileAsync(
|
||||
path.resolve('./utilities/templates/visual_regression_gallery.handlebars'),
|
||||
'utf8'
|
||||
),
|
||||
{ knownHelpersOnly: true }
|
||||
);
|
||||
|
||||
const html = template({
|
||||
date: moment().format('MMMM Do YYYY, h:mm:ss a'),
|
||||
|
@ -90,23 +94,14 @@ async function compareScreenshots() {
|
|||
session: undefined,
|
||||
baseline: undefined,
|
||||
diff: undefined,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
const sessionImagePath = path.resolve(
|
||||
SESSION_SCREENSHOTS_DIR,
|
||||
screenshot
|
||||
);
|
||||
const sessionImagePath = path.resolve(SESSION_SCREENSHOTS_DIR, screenshot);
|
||||
|
||||
const baselineImagePath = path.resolve(
|
||||
BASELINE_SCREENSHOTS_DIR,
|
||||
screenshot
|
||||
);
|
||||
const baselineImagePath = path.resolve(BASELINE_SCREENSHOTS_DIR, screenshot);
|
||||
|
||||
const diffImagePath = path.resolve(
|
||||
DIFF_SCREENSHOTS_DIR,
|
||||
screenshot
|
||||
);
|
||||
const diffImagePath = path.resolve(DIFF_SCREENSHOTS_DIR, screenshot);
|
||||
|
||||
const sessionImage = PNG.sync.read(await fs.promises.readFile(sessionImagePath));
|
||||
const baselineImage = PNG.sync.read(await fs.promises.readFile(baselineImagePath));
|
||||
|
@ -131,27 +126,27 @@ async function compareScreenshots() {
|
|||
comparison.change = change;
|
||||
|
||||
// Once the images have been diffed, we can load and store the image data.
|
||||
comparison.imageData.session =
|
||||
await readFileAsync(sessionImagePath, 'base64');
|
||||
comparison.imageData.session = await readFileAsync(sessionImagePath, 'base64');
|
||||
|
||||
comparison.imageData.baseline =
|
||||
await readFileAsync(baselineImagePath, 'base64');
|
||||
comparison.imageData.baseline = await readFileAsync(baselineImagePath, 'base64');
|
||||
|
||||
comparison.imageData.diff =
|
||||
await readFileAsync(diffImagePath, 'base64');
|
||||
comparison.imageData.diff = await readFileAsync(diffImagePath, 'base64');
|
||||
|
||||
return comparison;
|
||||
});
|
||||
}
|
||||
|
||||
export function run(done) {
|
||||
compareScreenshots().then(screenshotComparisons => {
|
||||
// Once all of the data has been loaded, we can build the gallery.
|
||||
buildGallery(screenshotComparisons).then(() => {
|
||||
done();
|
||||
});
|
||||
}, error => {
|
||||
console.error(error);
|
||||
done(false);
|
||||
});
|
||||
compareScreenshots().then(
|
||||
screenshotComparisons => {
|
||||
// Once all of the data has been loaded, we can build the gallery.
|
||||
buildGallery(screenshotComparisons).then(() => {
|
||||
done();
|
||||
});
|
||||
},
|
||||
error => {
|
||||
console.error(error);
|
||||
done(false);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue