how to dermine if a test failed in afterEach of a FunSpec in scalatest

青春壹個敷衍的年華 提交于 2019-12-01 12:38:50
adambsg

pretty sure I figured it out. coming from a TestNG background it seemed weird to have to mess with fixtures to accomplish it. I suspect others with a background like mine may also look in all the wrong places as well, so going to leave this here to help others:

override def withFixture(test: NoArgTest) = { // after
   val outcome = super.withFixture(test)
   outcome match {
     case Failed(ex) =>
     // log ex (the exception) and a screenshot
   }
   outcome
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!