Context:
Current situation
Desired situation
Benefit
Pointers welcome! Thanks,
Rob
Sure. Here's some TestSuiteRunListener.beforeRun code that throws an exception:
throw new Exception('boom!')
The project still runs the test even when that exception is thrown. An exception in a project-level event handler means that setup failed, in which case the tests are doomed. In a production environment involving hundreds or thousands of tests, a lot of lab time can be wasted running tests that shouldn't have run and human time wasted diagnosing failures actually caused by a failure in project setup.
See attached standalone project created with 1.7.0, which demonstrates the problem.
Is there an option to halt test execution if exceptions occur in an event handler?
Rob
Subject | Author | Latest Post |
---|---|---|