I have a few scala tests up and running but am confused as to how to close/quit webdriver upon completion of the run. I am aware of beforeAndAfterAll, but it seems that it acts on each test class whereas I only want to quit webdriver at the end (not inbetween each test & then restarting it). It doesn't appear to be doing anything, but here's what I've currently got:
class testRunHandler extends org.scalatest.Reporter{
import org.scalatest.events._
def apply(event: Event){
event match{
case _:RunCompleted => foo.driver.close()
case _ =>
}
}
I tried to follow this but wasn't sure how to apply it: Doing something before or after all Scalatest tests