0

I currently have Selenium with Java along with Cucumber for my UI automated tests. I seem to have hooked everything in as my tests run properly, but all of my tests seem to have an execution time of 0 ms, although I clearly see the tests running. How can I fix this?

0 ms passed| Reviews |.Given I am logged in
0 ms passed| Reviews |.When I am on some screen
0 ms passed| Reviews |.And I filter by x filter
0 ms passed| Reviews |.Then I should see x type displayed

EDIT: I have added in a Thread.sleep(3000) as the first step in one of my tests. It will still show an execution time of 0 ms. However, if in that same test, I Assert.fail() on that method, it will show me a proper execution time of 3 ms.

qaNoob
  • 17
  • 1
  • 3
  • 9
  • Depends on how the time passed was measured. The traditional method of `System.currentTimeMillis()` only have millisecond accuracy on some operating systems, and much larger on others, and the tests are probably fast enough for the difference between two calls to be 0. See http://stackoverflow.com/q/351565/53897 for more detail. – Thorbjørn Ravn Andersen Feb 09 '17 at 22:41
  • It does this if the steps you have given either do not return anything, are blank, or require a callback. – KyleFairns Feb 10 '17 at 11:49
  • @ThorbjørnRavnAndersen I added to my original post - I have added in a Thread.sleep(3000) to see if the test was too fast, but it was not the case. It will only properly report the 3ms execution time if my test fails. – qaNoob Feb 15 '17 at 00:26

0 Answers0