();
+
+const videoModeOutputPaths = (
+ testInfo: TestInfo,
+ artifactSuffix: string,
+): VideoModeOutputPaths => {
+ const name = (fileName: string) => suffixArtifactFileName(fileName, artifactSuffix);
return {
- metadata: join(testInfo.outputDir, VIDEO_MODE_METADATA_FILE),
- player: join(testInfo.outputDir, VIDEO_MODE_PLAYER_FILE),
- raw: join(testInfo.outputDir, VIDEO_MODE_RAW_FILE),
- rendered: join(testInfo.outputDir, VIDEO_MODE_RENDERED_FILE),
- reportPlayer: join(testInfo.outputDir, VIDEO_MODE_REPORT_PLAYER_FILE),
+ metadata: join(testInfo.outputDir, name(VIDEO_MODE_METADATA_FILE)),
+ player: join(testInfo.outputDir, name(VIDEO_MODE_PLAYER_FILE)),
+ raw: join(testInfo.outputDir, name(VIDEO_MODE_RAW_FILE)),
+ rendered: join(testInfo.outputDir, name(VIDEO_MODE_RENDERED_FILE)),
+ reportPlayer: join(testInfo.outputDir, name(VIDEO_MODE_REPORT_PLAYER_FILE)),
};
};
@@ -1258,8 +1282,8 @@ const recordHighlight = async (options: {
: undefined;
const image = pan
- ? `video-mode-pan-${options.state.highlightImageIndex}.png`
- : `video-mode-highlight-${options.state.highlightImageIndex}.png`;
+ ? `video-mode-pan${options.state.artifactSuffix}-${options.state.highlightImageIndex}.png`
+ : `video-mode-highlight${options.state.artifactSuffix}-${options.state.highlightImageIndex}.png`;
options.state.highlightImageIndex += 1;
const imagePath = join(options.testInfo.outputDir, image);
await mkdir(options.testInfo.outputDir, { recursive: true });
@@ -1546,7 +1570,7 @@ const recordFillReveal = async (options: {
return;
}
- const image = `video-mode-fill-${options.state.highlightImageIndex}.png`;
+ const image = `video-mode-fill${options.state.artifactSuffix}-${options.state.highlightImageIndex}.png`;
options.state.highlightImageIndex += 1;
await mkdir(options.testInfo.outputDir, { recursive: true });
await options.locator.page().screenshot({
@@ -3580,7 +3604,7 @@ const playwrightReportAttachmentName = async (path: string) => {
return `${createHash("sha1").update(data).digest("hex")}${extname(path)}`;
};
-const videoModePlayerHtml = (options: { raw: string; rendered?: string }) => {
+const videoModePlayerHtml = (options: { metadata: string; raw: string; rendered?: string }) => {
const primary = options.rendered || options.raw;
const primaryLabel = options.rendered ? "Rendered video" : "Raw video";
const primaryActiveKey = options.rendered ? "rendered" : "raw";
@@ -3724,7 +3748,7 @@ const videoModePlayerHtml = (options: { raw: string; rendered?: string }) => {
frame: 0
duration: ?s
Left/right steps one frame. Shift+left/right steps ten. Space toggles play.
-
+