【问题标题】:cypress-testrail-reporter creates separate runs for each of my test files in TestRail instead of one test runcypress-testrail-reporter 为我在 TestRail 中的每个测试文件创建单独的运行,而不是一个测试运行
【发布时间】:2021-10-05 00:14:00
【问题描述】:

我目前有 2 个测试文件,每次构建都会运行。似乎对于每个测试文件,它都会在 TestRail 中创建自己的测试运行。因此它会报告一个包含 4 个测试用例的测试运行和另一个包含 7 个测试用例的测试运行。

我需要和以前发生的事情是只运行 1 次测试,将所有 11 个案例都报告给 TestRail。

这是我的 cypress.json

  "reporterOptions": {
    "host": "https://yourdomain.testrail.com/",
    "username": "email",
    "password": "CYPRESS_TESTRAIL_REPORTER_PASSWORD",
    "projectId": 32,
    "suiteId": 103769,
    "runName":"Cypress Automated Test Run"

在构建过程中,我可以看到在每个测试文件之后都会打印出来 - Test run closed successfully

这在以前没有发生过。有什么改变吗,或者我需要做什么才能只进行 1 次测试。

【问题讨论】:

    标签: cypress testrail


    【解决方案1】:

    有一个选项includeAllInTestRun: true,或者确保测试标题中的案例代码实际上在同一个项目/套件中。

    it("C123 C124 Can authenticate a valid user", ...
    it("Can authenticate a valid user C321", ...
    

    案例 ID 提取为以“T”或“C”开头的任何单独的单词,后跟数字,

    let testCaseIdRegExp: RegExp = /\bT?C(\d+)\b/g;
    

    【讨论】:

    • 我正在查看一些文档,这是默认设置的 includeAllInTestRun: true。我仍然最终添加并将其设置为 true 并且没有工作。我仍在 TestRail 中进行多次测试。
    【解决方案2】:

    你可以使用

    npm install cypress-testrail-accumulative-reporter
    

    它将创建一个包含所有测试用例的测试运行

    【讨论】:

      猜你喜欢
      • 2018-12-20
      • 1970-01-01
      • 1970-01-01
      • 2021-12-05
      • 1970-01-01
      • 2020-02-21
      • 2020-12-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多