Skip to content

Commit 555e84d

Browse files
committed
adding new entries
1 parent 85ff2a0 commit 555e84d

7 files changed

Lines changed: 84 additions & 20 deletions

File tree

web-report/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"copyRunFiles": "cpx webreport.bat '../target/classes/webreport' && cpx webreport.command '../target/classes/webreport' && cpx webreport.py '../target/classes/webreport' && cpx 'src-e2e/static/robots.txt' '../target/classes/webreport'",
1212
"lint": "eslint .",
1313
"preview": "vite preview",
14-
"debug": "vite build && cpx 'src-e2e/static/*' '../target/classes/webreport' && vite preview",
14+
"debug": "vite build && cpx src-e2e/static/* ../target/classes/webreport && vite preview",
1515
"test": "vitest"
1616
},
1717
"dependencies": {

web-report/src-e2e/App.test.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ describe('App test', () => {
4141

4242
it('handles successful data loading', async () => {
4343
render(<App />);
44-
44+
4545
// Initially shows loading state
4646
expect(screen.getByText(/Please wait, files are loading.../)).toBeInTheDocument();
47-
47+
4848
// Wait for loading to complete and verify header data
4949
await waitFor(() => {
5050
expect(screen.queryByText(/Please wait, files are loading.../)).toBeNull();
@@ -80,10 +80,12 @@ describe('App test', () => {
8080
expect(screen.getByText(/Please wait, files are loading.../)).toBeInTheDocument();
8181
const total = reportData.problemDetails.rest.endpointIds.length;
8282
const outputHttpCalls = reportData.problemDetails.rest.outputHttpCalls;
83+
const evaluatedHttpCalls = reportData.problemDetails.rest.evaluatedHttpCalls;
8384

8485
await waitFor(() => {
8586
expect(screen.getByTestId('rest-report-endpoint')).toContainHTML(`${total}`);
86-
expect(screen.getByTestId('rest-report-http-calls')).toContainHTML(`${outputHttpCalls}`);
87+
expect(screen.getByTestId('rest-report-output-http-calls')).toContainHTML(`${outputHttpCalls}`);
88+
expect(screen.getByTestId('rest-report-evaluated-http-calls')).toContainHTML(`${evaluatedHttpCalls}`);
8789
});
8890

8991
});
@@ -143,4 +145,4 @@ describe('App test', () => {
143145
expect(screen.getByTestId('faults-component-fault-counts')).toContainHTML(faultCounts.length.toString());
144146
});
145147
});
146-
});
148+
});

web-report/src-e2e/static/report.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"toolName": "EvoMaster",
44
"toolVersion": "unknown",
55
"creationTime": "2025-04-09T19:31:54.258Z",
6+
"executionTimeInSeconds": 6780000,
67
"faults": {
78
"totalNumber": 529,
89
"foundFaults": [
@@ -2970,7 +2971,7 @@
29702971
},
29712972
"problemDetails": {
29722973
"rest": {
2973-
"outputHttpCalls": 130,
2974+
"outputHttpCalls": 25,
29742975
"endpointIds": [
29752976
"GET:/app/api/assignments",
29762977
"POST:/app/api/assignments",
@@ -3951,7 +3952,8 @@
39513952
200
39523953
]
39533954
}
3954-
]
3955+
],
3956+
"evaluatedHttpCalls": 132
39553957
}
39563958
},
39573959
"totalTests": 127,
@@ -4867,4 +4869,4 @@
48674869
]
48684870
}
48694871
]
4870-
}
4872+
}

web-report/src/assets/info.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"numberOfEndpoints": "Number of endpoints (verb:path) in the API.",
3-
"numberOfHttpCalls": "Total number of HTTP calls in the generated test suites.",
3+
"outputHttpCalls": "Total number of HTTP calls contained in all generated test cases - a single test case may include multiple calls (e.g., a POST followed by a GET and then a DELETE).",
4+
"evaluatedHttpCalls": "Total number of all HTTP calls made during the entire fuzzing session - in long runs, this can reach millions, while the generated tests include only a small subset of these calls.",
5+
"executionTimeInSeconds": "For how long, in seconds, the tool was running in total.",
46
"codeNumberIdentifiers": "Code number identifiers for detected fault types",
57
"identifierName": "Identifier name for the fault type.",
68
"testFilesLocated": "{numberOfTestCases} test cases are located in {fileName}",
@@ -15,4 +17,4 @@
1517
"creationDate": "Date when the report was generated.",
1618
"toolNameVersion": "Name and version of the tool that generated the report.",
1719
"schemaVersion": "Version of the schema used for the report."
18-
}
20+
}

web-report/src/components/Dashboard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ export const Dashboard: React.FC = () => {
114114
<Overview rest={data.problemDetails.rest}
115115
testCases={data.testCases}
116116
testFiles={numberOfTestCaseOfFiles}
117-
faults={data.faults}/>
117+
faults={data.faults}
118+
executionTimeInSeconds={data.executionTimeInSeconds}
119+
/>
118120
</TabsContent>
119121

120122
<TabsContent value="endpoints">

web-report/src/components/GeneratedTests.tsx

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Card} from "@/components/ui/card.tsx";
2-
import {Target} from "lucide-react";
2+
import {Target, Clock} from "lucide-react";
33
import type React from "react";
44
import {getFileColor, getText} from "@/lib/utils";
55
import info from "@/assets/info.json";
@@ -12,9 +12,25 @@ interface IGeneratedTests {
1212
numberOfTestCases: number
1313
}>
1414
outputHttpCalls?: number
15+
evaluatedHttpCalls?: number
16+
executionTimeInSeconds?: number
1517
}
1618

17-
export const GeneratedTests: React.FC<IGeneratedTests> = ({totalTests, testFiles, outputHttpCalls}) => (
19+
const formatExecutionTime = (totalSeconds?: number) => {
20+
if (totalSeconds === undefined || totalSeconds === null) return null;
21+
22+
const days = Math.floor(totalSeconds / 86400);
23+
const hours = Math.floor((totalSeconds % 86400) / 3600);
24+
const minutes = Math.floor((totalSeconds % 3600) / 60);
25+
const seconds = Math.floor(totalSeconds % 60);
26+
27+
return { days, hours, minutes, seconds };
28+
};
29+
30+
export const GeneratedTests: React.FC<IGeneratedTests> = ({totalTests, testFiles, outputHttpCalls, evaluatedHttpCalls, executionTimeInSeconds}) => {
31+
const timeBreakdown = formatExecutionTime(executionTimeInSeconds);
32+
33+
return (
1834
<Card className="border-2 border-black p-6 rounded-none">
1935
<div className="flex items-start gap-4">
2036
<Target className="w-6 h-6 text-gray-500"/>
@@ -32,11 +48,45 @@ export const GeneratedTests: React.FC<IGeneratedTests> = ({totalTests, testFiles
3248
<span className="text-lg font-bold" data-testid="generated-tests-total-tests">{totalTests}</span>
3349
</div>
3450
<div className="flex justify-between">
35-
<ReportTooltip tooltipText={info.numberOfHttpCalls}>
36-
<span className="text-lg font-bold"># HTTP Calls:</span>
51+
<ReportTooltip tooltipText={info.outputHttpCalls}>
52+
<span className="text-lg font-bold"># Output HTTP Calls:</span>
3753
</ReportTooltip>
38-
<span className="text-lg font-bold" data-testid="rest-report-http-calls">{outputHttpCalls}</span>
54+
<span className="text-lg font-bold" data-testid="rest-report-output-http-calls">{outputHttpCalls}</span>
3955
</div>
56+
<div className="flex justify-between">
57+
<ReportTooltip tooltipText={info.evaluatedHttpCalls}>
58+
<span className="text-lg font-bold"># Evaluated HTTP Calls:</span>
59+
</ReportTooltip>
60+
<span className="text-lg font-bold" data-testid="rest-report-evaluated-http-calls">{evaluatedHttpCalls}</span>
61+
</div>
62+
{timeBreakdown && (
63+
<div className="mt-4 p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-2 border-blue-300 rounded-lg">
64+
<ReportTooltip tooltipText={info.executionTimeInSeconds}>
65+
<div className="flex items-center gap-2 mb-3">
66+
<Clock className="w-5 h-5 text-blue-600"/>
67+
<span className="text-base font-bold text-blue-900">Execution Time</span>
68+
</div>
69+
</ReportTooltip>
70+
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3" data-testid="rest-report-execution-time">
71+
<div className="text-center bg-white rounded-lg p-3 border border-blue-200 shadow-sm">
72+
<div className="text-2xl font-bold text-blue-600">{timeBreakdown.days}</div>
73+
<div className="text-xs font-medium text-gray-600 mt-1">Days</div>
74+
</div>
75+
<div className="text-center bg-white rounded-lg p-3 border border-blue-200 shadow-sm">
76+
<div className="text-2xl font-bold text-indigo-600">{timeBreakdown.hours}</div>
77+
<div className="text-xs font-medium text-gray-600 mt-1">Hours</div>
78+
</div>
79+
<div className="text-center bg-white rounded-lg p-3 border border-blue-200 shadow-sm">
80+
<div className="text-2xl font-bold text-purple-600">{timeBreakdown.minutes}</div>
81+
<div className="text-xs font-medium text-gray-600 mt-1">Minutes</div>
82+
</div>
83+
<div className="text-center bg-white rounded-lg p-3 border border-blue-200 shadow-sm">
84+
<div className="text-2xl font-bold text-violet-600">{timeBreakdown.seconds}</div>
85+
<div className="text-xs font-medium text-gray-600 mt-1">Seconds</div>
86+
</div>
87+
</div>
88+
</div>
89+
)}
4090

4191
<div className="mt-4 pt-4 border-t border-gray-200">
4292
<div className="text-sm font-medium text-gray-700 mb-2">Test Files</div>
@@ -64,4 +114,5 @@ export const GeneratedTests: React.FC<IGeneratedTests> = ({totalTests, testFiles
64114
</div>
65115
</div>
66116
</Card>
67-
)
117+
);
118+
};

web-report/src/pages/Overview.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,25 @@ interface IOverviewType {
1212
numberOfTestCases: number
1313
}>,
1414
faults: Faults
15+
executionTimeInSeconds: number;
1516
}
1617

17-
export const Overview: React.FC<IOverviewType> = ({rest, testCases, testFiles, faults}) => {
18+
export const Overview: React.FC<IOverviewType> = ({rest, testCases, testFiles, faults, executionTimeInSeconds}) => {
1819
return (
1920
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
2021
{/* Left Panel */}
2122
{rest ? <RestReports {...rest}/> : <div>Please provide rest report.</div>}
2223
{/* Right Panel */}
2324
<div className="flex flex-col gap-6">
2425
{/* Generated Tests */}
25-
<GeneratedTests totalTests={testCases.length} testFiles={testFiles} outputHttpCalls={rest?.outputHttpCalls}/>
26+
<GeneratedTests totalTests={testCases.length} testFiles={testFiles}
27+
outputHttpCalls={rest?.outputHttpCalls}
28+
evaluatedHttpCalls={rest?.evaluatedHttpCalls}
29+
executionTimeInSeconds={executionTimeInSeconds}
30+
/>
2631
{/* Faults */}
2732
<FaultsComponent {...faults}/>
2833
</div>
2934
</div>
3035
)
31-
}
36+
}

0 commit comments

Comments
 (0)