【问题标题】:Displaying Spectron-Webdriverio test results in TeamCity在 TeamCity 中显示 Spectron-Webdriverio 测试结果
【发布时间】:2017-12-12 01:59:47
【问题描述】:

我想在 TeamCity 中显示 Spectron 测试结果。我已按照Webdriverio TeamCity Reporter page 的说明进行操作,分别是:

npm install wdio-teamcity-reporter --save-dev

并创建一个 wdio.conf.js 文件:

 exports.config = {
  reporters: ['teamcity'],
}

我已将此文件放在项目的顶部。它没有其他条目;我以前从来不需要它。

我也尝试了wdio-teamcity-reporter npm page.建议的附加配置

这是 package.json 中的 Jest 对象:

"jest": {
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js"
    ],
    "transform": {
      "\\.(ts|tsx)$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
    },
    "roots": [
      "<rootDir>/__tests__/",
      "<rootDir>/components/"
    ],
    "modulePaths": [
      "<rootDir>/__tests__/",
      "<rootDir>/components/"
    ],
    "testMatch": [
      "**/?(*.)(spec|test).(ts)?(x)"
    ]
  }

这是 package.json 中的相关命令(TeamCity 调用):

  "scripts": {
    // ...
    "test": "jest --maxWorkers=1 --forceExit",
    // ...
  },

此测试项目是使用 Typescript 和 Jest 构建的,仅包含针对 Electron 应用的 e2e Spectron 测试。该应用程序的构建工件是我的测试“构建”的 TeamCity 依赖项。在我的构建中,TeamCity 安装应用程序,运行 Spectron 测试(正在通过),然后卸载应用程序。

目前我只能看到构建日志中的 Jest 控制台输出。虽然有一些隐藏的文物,但我看不到正常的文物。我在想报告包应该产生一个 html 工件。如何显示测试选项卡或其他一些有用的结果?

【问题讨论】:

    标签: teamcity jestjs webdriver-io spectron


    【解决方案1】:

    事实证明,Jest 可以收集所有 Webdriver 结果。尝试使用https://www.npmjs.com/package/jest-teamcity

    在 jest.config.js 中使用:

    "testResultsProcessor": "jest-teamcity"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-07
      • 1970-01-01
      • 2014-10-08
      • 1970-01-01
      • 2013-08-20
      • 1970-01-01
      • 1970-01-01
      • 2010-12-17
      相关资源
      最近更新 更多