Skip to content

Commit 8609354

Browse files
Execution time (#41)
* added displaying of execution time for steps and scenarios
1 parent 1e8239a commit 8609354

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

CHANGELOG.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.15.1
2+
- fixed nano seconds conversion
3+
14
# 0.15.0
25
- migrated to react 18 and vite dev server
36
- added displaying of execution time for steps and scenarios

formatter/json_formatter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class JsonFormatter extends Formatter {
4343
const result= testCase.stepResults[step.id];
4444
step.result = {
4545
status: result.status.toLowerCase(),
46-
duration: result.duration.seconds * 1_000_000 + result.duration.nanos,
46+
duration: result.duration.seconds * 1_000_000_000 + result.duration.nanos,
4747
error_message: result.message
4848
};
4949
step.embeddings = testCase.stepAttachments[step.id]?.map(attachment => ({

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qavajs/html-formatter",
3-
"version": "0.15.0",
3+
"version": "0.15.1",
44
"main": "formatter/formatter.js",
55
"authors": [
66
"Alexandr Galichenko",

src/components/Scenario.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {TimeLabel} from "./TimeLabel";
77

88
const filterByStatus = (scenario: any, status: string) => scenario.steps.filter((step: any) => step.result.status === status);
99
const getScenarioDuration = (scenario: any) => {
10-
return `${(scenario.steps.reduce((duration: number, step: any) => duration + (step?.result.duration ?? 0), 0) / 1_000_000).toFixed(2)}s`
10+
return `${(scenario.steps.reduce((duration: number, step: any) => duration + (step?.result.duration ?? 0), 0) / 1_000_000_000).toFixed(2)}s`
1111
}
1212
const scenarioTitle = (scenario: any) => function ScenarioTitle() {
1313
const passed = filterByStatus(scenario, "passed").length;

src/components/Step.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const Step = ({step}: {step: any}) => {
9999
/>)
100100
}
101101
<FlexSpacer/>
102-
<TimeLabel time={`${(step.result.duration / 1_000_000).toFixed(2)}s`}/>
102+
<TimeLabel time={`${(step.result.duration / 1_000_000_000).toFixed(2)}s`}/>
103103
</FlexRow>
104104
<div style={{display: 'flex'}}>
105105
{step.arguments && step.arguments.map((arg: any, index: number) => <Argument key={index} arg={arg}/>)}

0 commit comments

Comments
 (0)