如何在scalatest/playspec中仅运行一项测试 [英] how to run only one test in scalatest/playspec

查看:138
本文介绍了如何在scalatest/playspec中仅运行一项测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的spec文件具有多个测试

"HomeController index page" should {
    "have title Welcome " in {
....
}

  "Home controller " should {
      "render homepage with csrfToken" in {
...
}

要在IntelliJ中运行测试,请在spec文件上输入right-click并选择run.但这将运行所有测试.有没有办法选择测试并仅运行所选的测试?

To run the tests in IntelliJ, I right-click on the spec file and select run. But this runs all the tests. Is there a way to select tests and run only the selected ones?

推荐答案

通过将光标置于测试方法内并按 Ctrl + Shift + F10 或通过创建ScalaTest运行/调试配置来指定要运行的测试名称.

You should be able to run individual tests by placing the cursor inside the test method and pressing Ctrl+Shift+F10 or by creating the ScalaTest run/debug configuration where you can specify the test name to run.

另请参见 Scala中的测试范围部分:

这篇关于如何在scalatest/playspec中仅运行一项测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆