Skip to content

Commit f77fe0f

Browse files
committed
compare-screenshots: output PR comment template
After taking screenshots, output an HTML table template that can be copied into a PR comment. The absolute paths serve as placeholders that can be selected and replaced by uploading the images. The paths are placed on their own lines so that users can easily triple-click to select the entire path, copy it, and then paste the uploaded image URL in its place. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 6fed49b commit f77fe0f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

script/compare-screenshots.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,19 @@ async function main() {
240240
console.log(`\nScreenshots saved:`);
241241
console.log(' - .before.png');
242242
console.log(' - .after.png');
243+
244+
console.log(`\nPR comment template (copy paths, then replace by uploading images):\n`);
245+
console.log(`<table>`);
246+
console.log(`<tr><th>Before</th><th>After</th></tr>`);
247+
console.log(`<tr>`);
248+
console.log(`<td>`);
249+
console.log(path.resolve('.before.png'));
250+
console.log(`</td>`);
251+
console.log(`<td>`);
252+
console.log(path.resolve('.after.png'));
253+
console.log(`</td>`);
254+
console.log(`</tr>`);
255+
console.log(`</table>`);
243256
} finally {
244257
await browser.close();
245258
}

0 commit comments

Comments
 (0)