Skip to content
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

Populate the "time" and "timestamp" element in the junit reports #119

Closed
candrews opened this issue Apr 1, 2014 · 6 comments
Closed

Populate the "time" and "timestamp" element in the junit reports #119

candrews opened this issue Apr 1, 2014 · 6 comments

Comments

@candrews
Copy link
Contributor

candrews commented Apr 1, 2014

junit xml files can have a "time" attribute on these elements:

  • testsuites
  • testsuite
  • testcase

"time" is the time in seconds that operation took.

This information would be really great to have in the junit reports so one can tell how long each part of the nightwatch test took. For example, in my current project, nightwatch is taking a very long time, but we don't know which tests are the taking the most time.

@candrews
Copy link
Contributor Author

candrews commented Apr 1, 2014

I've been banging my head on implementing this for a past few hours, and I just can't figure out where to set the start and finish times for each level. The code is really hard for me to wrap my mind around... I'm sure someone more familiar with nightwatch could have this done in minutes. :-/

@beatfactor
Copy link
Member

isn't it in milliseconds?

@beatfactor
Copy link
Member

it would be a very useful addition and I was just thinking about this the other day. I think the queue.js is the place to start.

@beatfactor
Copy link
Member

Just so you know I am implementing command timers. The time is shown per command so not per assertion, since an assertion has often multiple commands. And since the testcases in the junit reports are actually assertions the time will not show up in there for now. You will be able to see the elapsed time for a command when running nightwatch with --verbose. Is this acceptable for you?

@candrews
Copy link
Contributor Author

candrews commented Apr 3, 2014

@beatfactor that sounds like it would be very useful! Could you sum the times of the commands that compose an assertion to get the assertion time?
For the "testsuites" level time, I was thinking that saving the time when that test started, then when it ended, compare the current time to the saved time and that's testsuits/time. The same clock/different approach could be used the "testsuite" level too.

@beatfactor
Copy link
Member

This has been implemented in v0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants