首页 > 解决方案 > 自定义 mocha-bamboo-reporter 以包含测试文件名

问题描述

我正在尝试在量角器测试中自定义mocha-bamboo-reporter https://www.npmjs.com/package/mocha-bamboo-reporter以包含一个名为 的字段file,其中包括竹报告中的测试文件名。

摩卡竹记者

  var o = {
      title: test.title
    , fullTitle: test.fullTitle()
    , duration: test.duration
    , file: test.file    // this is the new change  
  };

当我在本地运行测试时,生成mocha.json的包含file我想要的信息。

摩卡.json

  {
      "title": "should show login form",
      "fullTitle": " Home Page should show login form",
      "duration": 300,
      "file": "xxx/tests/directory-name/test.js"
    }, 

在 Bamboo 中,我有一个Mocha Test Parser构建任务mocha.json,但在竹子报告file中从未包含,只有title,fullTitleduration。我需要做什么才能显示此信息?我需要包括一些东西mochaBambooReporterReporterOptions吗?

竹构建任务

在此处输入图像描述

标签: protractormocha.jsbamboo

解决方案


推荐阅读