Skip to content

Commit 32f4016

Browse files
authored
fix(report): fix status icon logic for assert failed (#1010)
1 parent 29b4ead commit 32f4016

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

apps/report/rsbuild.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default defineConfig({
116116
type: 'midscene_web_dump',
117117
playwright_test_description: item.data.groupDescription,
118118
playwright_test_id: `id-${index}`,
119-
playwright_test_title: 'test open new tab',
119+
playwright_test_title: item.data.groupName,
120120
playwright_test_status: 'passed',
121121
playwright_test_duration: Math.round(
122122
Math.random() * 100000,

apps/report/src/components/sidebar.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import './sidebar.less';
22
import { useAllCurrentTasks, useExecutionDump } from '@/components/store';
3-
import { PauseOutlined } from '@ant-design/icons';
43
import type { ExecutionTask, ExecutionTaskInsightLocate } from '@midscene/core';
54
import {
65
type AnimationScript,
@@ -66,10 +65,17 @@ const SideItem = (props: {
6665
statusText = timeCostStrElement(task.timing.cost);
6766
}
6867

69-
const statusIcon =
70-
task.status === 'finished' && task.error
71-
? iconForStatus('finishedWithWarning')
72-
: iconForStatus(task.status);
68+
const statusIcon = (() => {
69+
const isFinished = task.status === 'finished';
70+
const isAssertFailed = isFinished && task.output === false;
71+
const hasError = isFinished && (task.error || task.errorMessage);
72+
73+
if (isAssertFailed) return iconForStatus('failed');
74+
75+
if (hasError) return iconForStatus('finishedWithWarning');
76+
77+
return iconForStatus(task.status);
78+
})();
7379

7480
const titleTextIcon =
7581
task.type === 'Planning' ? (

0 commit comments

Comments
 (0)