在Testcafe隔离模式下所有失败的尝试?

发布于 2025-02-10 06:08:59 字数 1221 浏览 1 评论 0原文

我的TestCafe配置中启用了隔离模式。

"ci-e2e": {
    "browsers": [
        "chrome:headless"
    ],
    "debugOnFail": false,
    "src": "./tests/e2e/*.test.ts",
    "concurrency": 1,
    "quarantineMode": true,
    "reporters": [
        {
            "name": "nunit3",
            "output": "results/e2e/testResults.xml"
        },
        {
            "name": "spec"
        }
    ],
    "screenshots": {
        "takeOnFails": true,
        "path": "results/ui/screenshots",
        "pathPattern": "${DATE}_${TIME}/${FIXTURE}/${TEST}/Screenshot-${QUARANTINE_ATTEMPT}.png"
    },
    "video": {
        "path": "results/ui/video",
        "failedOnly": true,
        "pathPattern": "${DATE}_${TIME}/${FIXTURE}/${TEST}/Video-${QUARANTINE_ATTEMPT}"
    }
},

现在,当一些尝试失败时,我将进入日志(Nunit XML LogFile),其中包含有关运行失败的信息,只有一个堆栈跟踪。我有每个失败的运行截图。

<failure>
    <message>
        <![CDATA[ ❌ AssertionError: ... Run 1: Failed Run 2: Failed Run 3: Failed ]]>
    </message>
    <stack-trace>
        here we have stack-trace for only one failed run
    </stack-trace>
</failure>

我想为每个失败测试的每次失败运行带有堆栈跟踪的日志条目。是否可以通过这种方式配置TestCafe?如果不是我需要做的?

I have quarantine mode enabled in my testcafe configuration.

"ci-e2e": {
    "browsers": [
        "chrome:headless"
    ],
    "debugOnFail": false,
    "src": "./tests/e2e/*.test.ts",
    "concurrency": 1,
    "quarantineMode": true,
    "reporters": [
        {
            "name": "nunit3",
            "output": "results/e2e/testResults.xml"
        },
        {
            "name": "spec"
        }
    ],
    "screenshots": {
        "takeOnFails": true,
        "path": "results/ui/screenshots",
        "pathPattern": "${DATE}_${TIME}/${FIXTURE}/${TEST}/Screenshot-${QUARANTINE_ATTEMPT}.png"
    },
    "video": {
        "path": "results/ui/video",
        "failedOnly": true,
        "pathPattern": "${DATE}_${TIME}/${FIXTURE}/${TEST}/Video-${QUARANTINE_ATTEMPT}"
    }
},

Now when some attempt fails I have entry in log (nunit xml logfile) with information about failed runs and only one stack-trace. I have screenshot for each failed run.

<failure>
    <message>
        <![CDATA[ ❌ AssertionError: ... Run 1: Failed Run 2: Failed Run 3: Failed ]]>
    </message>
    <stack-trace>
        here we have stack-trace for only one failed run
    </stack-trace>
</failure>

I want to have log entry with stack-trace for each failed run for each failed test. Is it possible to configure testcafe this way? If not what I need to do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赠意 2025-02-17 06:08:59

配置文件中有一个错误。记者的选项名称应为Reporter,但它是Reporter。这意味着TestCafe根本不使用这些记者,也许现在您只看到一个带有结果的过时文件。

There is a mistake in the config file. The name of the option for reporters should be reporter, but it is reporterS. It means that Testcafe doesn't use these reporters at all and maybe now you just see an outdated file with results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文