diff --git a/playwright/reporters/reporter.js b/playwright/reporters/reporter.js index 31d70231e3..865b9cc8df 100644 --- a/playwright/reporters/reporter.js +++ b/playwright/reporters/reporter.js @@ -6,6 +6,7 @@ const FailedRuns = {}; let startTime = 0; class MyReporter { onBegin(config, suite) { + console.log(`This is an automated test report`); console.log(`Running ${suite.allTests().length} tests`); startTime = new Date().getTime(); } @@ -13,14 +14,14 @@ class MyReporter { onTestBegin() {} onTestEnd(test, result) { - if (result.status === 'failed' && test.retry > 1) { + if (result.status === 'failed') { // get the first word of the test title const title = test.title.split(' ')[0]; FailedRuns[title] = test; } } - onEnd(result) { + onEnd() { // duration const endTime = new Date().getTime(); const duration = endTime - startTime; @@ -28,30 +29,35 @@ class MyReporter { const minutes = Math.floor(duration / 60000); const seconds = ((duration % 60000) / 1000).toFixed(0); - console.log(`This is an automated visual test report.`); - - if (result.status === 'failed') { + if (Object.keys(FailedRuns).length > 0) { console.log(`### Failed Visual Snapshots ❌`); + console.log('-----------------------------------'); console.log( - 'These test failures may or may not be related to your changes. These are not blocking.', + 'Note: These test failures may or may not be related to your changes. They are not blocking.', ); + console.log(''); console.log(Object.keys(FailedRuns).length, ' failed visual tests:'); Object.keys(FailedRuns).forEach((title) => { console.log(`- ${title}`); }); - console.log(`To see the failed tests, run the following command:`); - console.log(`yarn run playwright:visual-test test --ui"`); + console.log(`To see the failed tests, run the following command locally:`); + console.log(`\`yarn run playwright:visual-test test --ui\``); + + console.log(''); + console.log(''); console.log(`To update failed tests, run`); - console.log(`yarn run playwright:visual-test --update-snapshots"`); + console.log(`\`yarn run playwright:visual-test --update-snapshots\``); + + console.log(''); - console.log(`Total Test Run Time: ${minutes}:${seconds}`); + console.log(`Total Test Run Time: ${minutes}m ${seconds}s`); } else { console.log(`All visual tests passed ✅`); - console.log(`Total Test Run Time: ${minutes}:${seconds}`); + console.log(`Total Test Run Time: ${minutes}m ${seconds}s`); } } } diff --git a/playwright/visual-test/BannerUpsell-dark.spec.mjs-snapshots/BannerUpsell-dark-chromium-darwin.png b/playwright/visual-test/BannerUpsell-dark.spec.mjs-snapshots/BannerUpsell-dark-chromium-darwin.png new file mode 100644 index 0000000000..b8300a59da Binary files /dev/null and b/playwright/visual-test/BannerUpsell-dark.spec.mjs-snapshots/BannerUpsell-dark-chromium-darwin.png differ diff --git a/playwright/visual-test/BannerUpsell.spec.mjs-snapshots/BannerUpsell-chromium-darwin.png b/playwright/visual-test/BannerUpsell.spec.mjs-snapshots/BannerUpsell-chromium-darwin.png new file mode 100644 index 0000000000..77ba23db6b Binary files /dev/null and b/playwright/visual-test/BannerUpsell.spec.mjs-snapshots/BannerUpsell-chromium-darwin.png differ