scala - Intellij 不提供弹出窗口或菜单选项来运行由 Intellij 本身创建的 scalatest

标签 scala intellij-idea scalatest

我不确定为什么给定的 scala 项目没有被识别为 scalatest - 有能力/准备就绪..

实际上,可以通过点击 Shift-Command-T 来生成新的 ScalaTest。但我无法运行它们..

enter image description here

该对话框显示 ScalaTest 运行正常:

enter image description here

并生成正确的 ScalaTest-ready 类:

import org.scalatest.FunSuite

class MetricUtilsTest extends FunSuite {

  test("testF") {

  }

  test("testError") {

  }

}

但是,没有弹出窗口或菜单选项来允许从 IJ 中运行/调试测试:

enter image description here

我尝试过的事情

  • 删除 Intellij 项目并从头开始
  • 多个不同的测试套件(都无法运行)

请注意,新创建的测试确实从命令行运行(这向我们表明maven项目运行良好):

 mvn exec:java -Dexec.mainClass=com/blazedb/spark/MetricUtilsTest.scala -Dexec.args=""

更新我能够手动设置运行配置新创建的测试并成功运行测试

enter image description here

那么..弹出菜单在这里不起作用是怎么回事?我正在使用 Ultimate 2019.1

最佳答案

找到了!不知何故,选择了以下(我认为不是默认的?)设置:

enter image description here

我从来没有使用过gradle,所以不确定如何/何时设置。明显的解决方法是将其重置为平台测试运行器:

enter image description here

瞧,我们回到了预期的弹出对话框,其中包括运行/调试当前scalatest的选项:

enter image description here

请注意,此问题是通过使用操作搜索对话框(shift-command-A)并键入“运行测试”来诊断的

关于scala - Intellij 不提供弹出窗口或菜单选项来运行由 Intellij 本身创建的 scalatest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55840841/

相关文章:

spring-boot - Kotlin Spring Boot 注解处理 "Cannot Resolve Configuration Processing"

intellij-idea - .vimrc 用于 IntelliJ Idea 的 vim 插件

java - 无法在 Intellij 上导入 ArrayUtils

scala - 是否有一个类似于TestNg的scalaTest机制DependOnMethods批注

Scala 的编译器词法分析器

scala - 在dispatch-classic中使用cookie

scala - Spark : explode multiple columns into one

scala - 检查 Scala 类是否是 T 的实例

Scalatest "At least one"代替 Forall

java - sbt Scalatest NoClassDefFoundError