I'm a java noob, but I'm playing with some code using Java8 and Selenium for testing a web applications.
I've been told that assertThat is the preferred method to do assertions. But I'm wondering: Is there supposed to be a long timeout before an assertThat fails? In my example, I'm asserting something I KNOW is not true, and it takes about one minute before the assertion fails.
Once it fails, it presents nice feedback about what failed, but I don't understand why it takes so long to fail?
The code is pretty easy and self-explanatory, I think. The two string values are sound. But the assertion takes about a minute to fail. Why is that? In my case, it's a problem because there are hundreds of these assertions in the code, and the time to run the whole suite is potentially much longer if every failed assertion adds a minute to the run time.
Any ideas? Again, sorry if this is too basic or stupid.
It could be your method is also taking long to run. Check how long does the method that returns caseRef takes to run. The good practice will be to use the mocks against the actual call if the method is making calls to the database or external services perhaps.
posted 2 months ago
Thanks for the tips. It turned out that the problem was the framework and operations that were automatically executed every time a test and/or assert failed.
Paper beats rock. Scissors beats tiny ad.
Programmatically Create PDF Using Free Spire.PDF with Java