【问题标题】:Azure CI Pipeline YAML for Specflow Integration用于 Specflow 集成的 Azure CI 管道 YAML
【发布时间】:2021-07-28 14:14:48
【问题描述】:

我正在尝试使用 Azure CI 管道配置我的规范流程项目。当我尝试使用 TestExecution.json 创建 Specflow+LivingDoc 时,管道无法找到路径。附上我的 YAML 和 specflow.json。有人可以帮我解决这个问题吗?

YAML

- task: SpecFlowPlus@0
  displayName: 'Upload SpecFlow Living Docs'
  inputs:
    projectFilePath: 'MyProjecct'
    projectName: 'MyProjecct'
    testExecutionJson: '**\TestExecution.json'
    projectLanguage: 'en'

specflow.json

{
    "livingDocGenerator": {
      "enabled": true,
      "filePath": "{CurrentDirectory}\\TestResults\\TestExecution.json"
    }
  }

错误

Error

##[error]Error: Command failed: dotnet D:\a_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.859\CLI\LivingDoc.CLI.dll feature-folder "D:\a\1\s\MyProjecct" --output-type JSON --test-execution-json "**/TestExecution.json" --output "D:\a\1\s\16707\FeatureData.json" --project-name "MyProjecct" --project-language "en"

【问题讨论】:

  • 请发布整个错误信息
  • ##[错误]错误:命令失败:dotnet D:\a_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.859\CLI\LivingDoc.CLI.dll 功能文件夹“D :\a\1\s\MyProjecct" --output-type JSON --test-execution-json "**/TestExecution.json" --output "D:\a\1\s\16707\FeatureData.json" --project-name "MyProjecct" --project-language "en"
  • 文件是否在指定文件夹中生成?
  • edit您的问题以纯文本形式包含错误消息。评论太难读了。
  • @GregBurghardt 完成

标签: selenium azure-devops continuous-integration specflow


【解决方案1】:

可以在SpecFlowPlus任务前添加shell任务(如Bask)执行ls命令,查看当前目录下指定Feature文件夹中是否已经生成或存在TestExecution.json文件。

ls -R

如果TestExecution.json文件不存在,你应该去检查生成这个文件的步骤是否有问题。

【讨论】:

  • 我试图在我的本地机器上生成 specflow live doc,它按预期工作。但是对于 CI 管道,当它尝试执行 textExecutionjsonPath 时,命令失败
【解决方案2】:

几天前我尝试配置时遇到了同样的错误。

尝试提供 TestExecution.json 的完整路径,应该可以。模式匹配在文件路径中不起作用,因此请提供您的 json 文件以及项目/测试程序集等的完整路径...

【讨论】:

    猜你喜欢
    • 2020-12-20
    • 2020-10-12
    • 1970-01-01
    • 2020-02-06
    • 1970-01-01
    • 2022-08-09
    • 1970-01-01
    • 2021-02-12
    • 1970-01-01
    相关资源
    最近更新 更多