I am using testcafe to test an app served through SpringBoot.
I am successfully using appCommand
to start the app before launching the tests. However, the app takes a bit to start (10-30 seconds, depending on the environment and load) so I need to use appInitDelay=40000
.
It is a problem, because if the app takes only 10s to start... 20s are wasted... and precisely it takes short in the dev environment, where having the developer waiting for nothing for 20 extra seconds is a pain for the productivity (lost of focus).
Is there any better approach?
I have tried pageRequestTimeout
but it does not work, because the tomcat is not ready and the test fails even before waiting for the page (the pageRequestTimeout is not even triggered). I have also tried retryTestPages
but neither it works, because tomcat is ready around 1s before the actual SpringBootApp is ready... so the connection happens and tomcat return an error... again causing the test to fail.
Any other idea?