A class rule that cleans up web drivers from the
LifecycleAwareWebDriverGrid
after a specific amount of time elapses since the last test has been run.
Some
WebDrivers suffer from bugs that prevent shutdown hooks from cleaning them
up properly. If you need to run your tests using those browsers (e.g. Chrome, IE), use this rule to
make sure the browser will be closed after the test suite finishes.
This rule is only effective if you use it in all your tests as a class rule. If you are using an injection context
(e.g. a
TestedProduct with a
PageBinder),
make sure this product's life cycle does not exceed this rule's life cycle (which is generally
true,
if you use a
ProductContextRunner, or just manually instantiate
the produce per test class).
When instantiating the class clients can set a custom timeout, or use default constructor that sets a 3 seconds
timeout.