gpt4 book ai didi

jasmine - 如何关闭堆栈失败消息?

转载 作者:行者123 更新时间:2023-12-04 11:54:48 24 4
gpt4 key购买 nike

在运行测试服时,当某些事情失败时,它也会显示这样的堆栈消息

Failures:
1) Should validate labels
Message:
Failed: No element found using locator: By.cssSelector(".container h1")
Stack:
NoSuchElementError: No element found .........................
.........
......
....

我们可以关闭这个堆栈输出吗?我试过了
protractor conf.js --no-stackTrace

还使用设置更新了 conf.js 文件
stackTrace: false,
// Options to be passed to Jasmine.
jasmineNodeOpts: {
defaultTimeoutInterval: 30000,
includeStackTrace: false,
}

但它总是显示堆栈输出,如何解决?

最佳答案

如果您使用的是旧 Protractor (我认为 <=1.4),请同时设置 isVerboseincludeStackTracefalse会为你工作:

jasmineNodeOpts: {
isVerbose: false,
includeStackTrace: false
}

不幸的是,如今 isVerboseincludeStackTracejasmineNodeOpts 中不会被识别(说明 here):

Similar to jasmine 1.3, you may include jasmineNodeOpts in the config file. However, because we changed the runner from "https://github.com/juliemr/minijasminenode" to "https://github.com/jasmine/jasmine-npm", the options have changed slightly. Notably options print and grep are new, but we will no longer support options isVerbose and includeStackTrace (unless, of course, "jasmine-npm" introduces these options).



也可以看看:
  • isVerbose has no effect
  • 关于jasmine - 如何关闭堆栈失败消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32606310/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com