自定义TestRail报告程序的TestCafe无法获取测试结果

时间:2019-07-09 09:20:35

标签: webdriver automated-tests testcafe testrail wdio-v4

我有自定义的TestRail(TR)报告程序集,并且正在使用标准WDIO项目。基本上,它从CI获取Json中的TR参数,以获取测试结果并将其通过“ testrail-api”发布到TR。 使用的记者:

reporterOptions: {
        outputDir:   './mochawesome-report',
        mochawesome_filename: 'results.json',
        testRailReporter: TRreporterConfig
},

现在,我将项目迁移到TestCafe,并且需要在此处申请相同的报告者。

我确实设置了自定义“ TestRailReporter”, 从wdio.conf.json int testcafe.conf.json移动了所有参数。 我可以使用在代码中看到的指定自定义参数开始运行。

但是,TRreporterConfig个记者没有获得任何数据,因此TR中没有填写任何结果。

测试触发: testcafe chrome tests --TEST_RAIL_RUN_PARAMS="{\"project\":{\"id\": 1,\"name\":\"MyProject\"},\"run\":{\"id\": 1},\"suite\":{\"id\": 1,\"name\": \"MyProject\"}}"

已解析并为测试运行提供了这些参数

为了在TestCafe中获取测试结果,是否需要添加特殊的“挂钩”?

2 个答案:

答案 0 :(得分:1)

您不能将自定义参数直接传递给TestCafe,因此testcafe chrome tests --TEST_RAIL_RUN_PARAMS...命令不起作用。

要获取测试结果并进行处理,TestCafe提供了Custom Reporters mechanism

覆盖所有必需的报告程序方法,并将所有自定义逻辑放入其中。

答案 1 :(得分:0)

您可以尝试将 testrail-simple 报告器用于 TestCafe。

易于设置和使用。

https://www.npmjs.com/package/testcafe-reporter-testrail-simple

相关问题