Skip to content

Commit 1160906

Browse files
committed
fix: htmlReporter plugin cannot set step.duration (getter-only property)
- Changed to use step.htmlReporterDuration instead of step.duration - step.duration is a getter that calculates from startTime/endTime - All step tracking now uses custom htmlReporterDuration property - Falls back to step.duration if htmlReporterDuration not available - Applies to both regular steps and BDD steps - All existing tests pass - Version bumped to 4.0.0-beta.12
1 parent 1071207 commit 1160906

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/plugin/htmlReporter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default function (config) {
143143

144144
event.dispatcher.on(event.step.finished, step => {
145145
if (step.htmlReporterStartTime) {
146-
step.duration = Date.now() - step.htmlReporterStartTime
146+
step.htmlReporterDuration = Date.now() - step.htmlReporterStartTime
147147
}
148148

149149
// Serialize args immediately to preserve them through worker serialization
@@ -170,7 +170,7 @@ export default function (config) {
170170
actor: step.actor,
171171
args: serializedArgs,
172172
status: step.failed ? 'failed' : 'success',
173-
duration: step.duration || 0,
173+
duration: step.htmlReporterDuration || step.duration || 0,
174174
})
175175
})
176176

@@ -210,13 +210,13 @@ export default function (config) {
210210

211211
event.dispatcher.on(event.bddStep.finished, step => {
212212
if (step.htmlReporterStartTime) {
213-
step.duration = Date.now() - step.htmlReporterStartTime
213+
step.htmlReporterDuration = Date.now() - step.htmlReporterStartTime
214214
}
215215
currentBddSteps.push({
216216
keyword: step.actor || 'Given',
217217
text: step.name,
218218
status: step.failed ? 'failed' : 'success',
219-
duration: step.duration || 0,
219+
duration: step.htmlReporterDuration || step.duration || 0,
220220
comment: step.comment,
221221
})
222222
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeceptjs",
3-
"version": "4.0.0-beta.11.esm-aria",
3+
"version": "4.0.0-beta.12",
44
"type": "module",
55
"description": "Supercharged End 2 End Testing Framework for NodeJS",
66
"keywords": [

0 commit comments

Comments
 (0)