Search code examples
javascriptnode.jsfunctional-testinginternleadfoot

Difference between Intern's / Leadfoot's timeout functions


Leadfoot has the method setTimeout() which takes 'script', 'implicit', or 'page load' as parameters, but it also has setPageLoadTimeout(), and setFindTimeout(). What is the difference between setFindTimeout and implicit? What is the difference between setPageLoadTimeout and page load? Is using both overkill? Is one of the better than the other?


Solution

  • The specialized methods setPageLoadTimeout, setFindTimeout, and setExecuteAsyncTimeout all call setTimeout (see https://theintern.github.io/leadfoot/Session.js.html#line2198). You can use either the specialized methods or the generic setTimeout, but it's typical to use the specialized methods.

    The specialized convenience functions were created because they’re way clearer about what they actually do: setFindTimeout sets the timeout for find calls, and setExecuteAsyncTimeout sets the timeout for executeAsync calls.