-
-
Notifications
You must be signed in to change notification settings - Fork 121
Show duration #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show duration #28
Conversation
…ion option is set to true
…high time sensitivity
|
Hi @LennDG Tnx for the PR. This looks already nice. I think we also need to update the other templates (custom-meta templates). I'll also think about a the time in the overview page. Total time can't be calculated because we don't know if the tests have been executed in parallel. I only need to check when I have time to dive into this because I have a busy weekend and week, but I'll come back on it. Again tnx! |
|
The custom templates are only for the features overview page (that one might want duration so you can see the duration on the overview page) and for the metadata overview on a feature page, but on that page the duration is already displayed below the chart. |
wswebcreation
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @LennDG,
I finally got time ti review your PR, I just got settled in my new home.
This PR looks good, I do have some feedback. I can also push the changes if you don't have time
| m = timeData.m ? timeData.m + "m" : ""; | ||
| h = timeData.h ? timeData.h + "h" : ""; | ||
| d = timeData.d ? timeData.d + "d" : ""; | ||
| return d + h + m + s + ms; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine by me, I didn't think of different ways to display and just used the format that the Cucumber Jenkins Plugin uses.
| }); | ||
| } | ||
|
|
||
| // From https://gist.github.com/remino/1563878 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For calculating times I'd prefer using a library to keep this code as clean as possible, I don't want to make unit test for time calculations, they always go wrong. We can use momentjs for it and solve the time calculation with 3 lines of code and a require at the top of the file.
const moment = require('moment');
function formatDuration(ms) {
return moment.utc(ms).format("HH:mm:ss.SSS")
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I didn't want to add extra dependencies with my PR. Using a library will save some headaches.
|
|
||
| You can change the report name to a name you want | ||
|
|
||
| ### `displayDuration` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for adding this as an option!!
| - **Mandatory:** No | ||
|
|
||
| If set to true the duration of steps, scenarios and features is displayed on the Feature page in an easily readable format. | ||
| This expects the durations in the report to be in milliseconds, which might result in incorrect durations when using a version of Cucumber that does not report in milliseconds (like v.1). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
Overall you can just push these changes since I have nothing more to add. Looking forward to using the official package again! |


PR for the show duration issue.
Adds support for duration display in a readable format.