Selenium Webdriver.io 测试运行器未记录测试规范的标题 ("it should...")

Selenium Webdriver.io test runner is not logging the titles of the test specs ("it should...")

我正在将这个 javascript API 用于名为 Webdriver.io 的 Selenium。我正在使用 jasmine 框架和 运行 使用 webdriverio 的 $ wdio 命令进行测试。我在 wdio.conf.js 文件中将 loggingLevel 设置为 verbose,但它仍然没有在终端中打印规范的标题("it should test ...")。我不想增加维护 console.log() 的难度。我怎么解决这个问题。

如果您希望在 运行 测试时查看包含规格详细信息的完整测试结果,您可以将默认报告器从 'dot' 更改为 'spec'。在您的 wdio.conf.js 文件中,查找以下行:

reporters: ['dot'],

改为:

reporters: ['spec'],

您可能需要安装规范报告程序:

npm install wdio-spec-reporter

无需将日志级别设置为详细,您可以将其切换回静默。