我已经开发了一个执行nightwatch.js测试用例的azure自定义管道任务(构建和发布)。
当连接到chrome时,nightwatch会生成一个信息日志(如下图所示)。但是,这些日志被认为是管道中的错误,并且自定义任务显示为失败(参见第二个图像)。有没有什么办法可以抑制来自nightwatch.js的信息日志?


Task.json代码
{
"$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json",
"id": "c786b1f1-37f1-44d6-ba55-5abe126bb031",
"name": “CustomTaskName”,
"friendlyName": "CustomTaskName Friendly Name,
"description": “desc”,
"helpMarkDown": "",
"category": "Utility",
"author": "Chandan",
"version": {
"Major": 0,
"Minor": 1,
"Patch": 0
},
"instanceNameFormat": "Echo $(url)",
"inputs": [
{
"name": "url",
"type": "string",
"label": "URL of your website",
"defaultValue": "",
"required": true,
"helpMarkDown": "URL of your website which needs testing"
}
],
"execution": {
"PowerShell": {
"target": "$(currentDirectory)\\command.ps1",
"argumentFormat": "",
"workingDirectory": ""
}
}
}发布于 2021-03-22 16:06:58
您可以尝试在nightwatch.conf.js配置文件中添加slient: true。
live_output: false,
silent: true,
output: true,
detailed_output: false,
disable_error_log: false,您可以在官方document的输出设置部分找到相关详细信息。

https://stackoverflow.com/questions/66731250
复制相似问题