Run Test setup before all tests
Question
I'm using ScalaTest for BDD testing of an app.
The BeforeAndAfterAll
trait lets me run setup before a running the tests in a specific feature.
But I need to run setup before any of the tests run.
What is the simplest way to achieve this?
Solution
Mixin the BeforeAndAfterAll trait and implement beforeAll
… extends with BeforeAndAfterAll {
override def beforeAll(configMap: Map[String, Any]) { // Set up code }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow