Skip to content

Commit 8d318a9

Browse files
committed
adjust screenshot name
1 parent ca53944 commit 8d318a9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scripts/pit/its/test-utils.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,17 @@ async function takeScreenshot(page, arg, testFile, subject) {
152152
const testName = path.basename(testFile).replace('.js', '');
153153
const cnt = String(++sscount).padStart(2, "0");
154154
// Use _0_ prefix for 'before' and _1_ prefix for 'after' so they sort first
155+
let ssType = undefined;
155156
let prefix = '';
156157
if (subject === 'before') {
157-
prefix = '_0_';
158+
ssType = '0_befr';
159+
prefix = '_';
158160
} else if (subject === 'after') {
159-
prefix = '_1_';
161+
ssType = '1_aftr';
162+
prefix = '_';
160163
}
161-
const parts = [arg.name, arg.mode, arg.version, testName, subject, cnt].filter(Boolean);
162-
const file = `${screenshots}/${prefix}${parts.join('-')}.png`;
164+
const parts = [arg.name, arg.mode, ssType, arg.version, testName, subject, cnt].filter(Boolean);
165+
const file = `${screenshots}/${parts.filter(s => !!s).join('-')}.png`;
163166
await page.waitForTimeout(/^win/.test(process.platform) ? 10000 : process.env.GITHUB_ACTIONS ? 800 : 200);
164167
await page.screenshot({ path: file });
165168
ok(` 📸 Screenshot taken: ${file}\n`);

0 commit comments

Comments
 (0)