Skip to content

Commit a623862

Browse files
authored
fix(report): handling for normal tasks in animation scripts like aiAssert/aiQuery (#1032)
1 parent 76ea8e0 commit a623862

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

packages/visualizer/src/component/replay-scripts.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,6 @@ export const generateAnimationScripts = (
231231
}
232232
}
233233

234-
// remove assertion and query tasks
235-
tasksIncluded = tasksIncluded.filter(
236-
(task) => task.type !== 'Assertion' && task.type !== 'Query',
237-
);
238-
239234
if (tasksIncluded.length === 0) {
240235
return null;
241236
}
@@ -411,6 +406,22 @@ export const generateAnimationScripts = (
411406
subTitle,
412407
});
413408
}
409+
} else {
410+
// Handle normal tasks
411+
const title = typeStr(task);
412+
const subTitle = paramStr(task);
413+
const screenshot = task.recorder?.[task.recorder.length - 1]?.screenshot;
414+
415+
if (screenshot) {
416+
scripts.push({
417+
type: 'img',
418+
img: screenshot,
419+
duration: stillDuration,
420+
camera: fullPageCameraState,
421+
title,
422+
subTitle,
423+
});
424+
}
414425
}
415426
if (task.status !== 'finished') {
416427
errorStateFlag = true;

0 commit comments

Comments
 (0)