我目前正在使用 cucumber 集成 cypress mochawesome 报告,但是当使用测试用例生成 index.html 文件时,如果单击任何测试,我看到的只是 JS 代码,而不是执行的 cucumber 步骤。请帮助我,我目前使用的是 cypress mochawesome reports 3.4.0 版本。这是我的 cypress 项目的配置:
赛普拉斯.config.js
const { defineConfig } = require("cypress");
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
const preprocessor = require("@badeball/cypress-cucumber-preprocessor");
const createEsbuildPlugin = require("@badeball/cypress-cucumber-preprocessor/esbuild");
module.exports = defineConfig({
reporter: 'cypress-mochawesome-reporter',
e2e: {
setupNodeEvents(on, config) {
require('cypress-mochawesome-reporter/plugin')(on)
And here a screenshot of the issue in the index.html test cases
[var _a2, _b, _c, _d, _e;
const { remainingSteps, testCaseStartedId } = retrieveInternalSpecProperties();
if (context.messagesEnabled) {
taskTestCaseStarted({
id: testCaseStartedId,
testCaseId,
attempt: attempt++,
timestamp: (0, messages_1.createTimestamp)()
});
}
window.testState = {
gherkinDocument,
pickles,
pickle
};
for (const step of steps) {
if (step.hook) {
const hook = step.hook;
cy.then(() => {
delete window.testState.pickleStep;
const start = (0, messages_1.createTimestamp)();
if (context.messagesEnabled) {
taskTestStepStarted({
testStepId: hook.id,
testCaseStartedId,
timestamp: start
});
}
return cy.wrap(start, { log: false });
}).then((start) => {
(0, cypress_1.runStepWithLogGroup)({
fn: () => registry2.runHook(this, hook),
keyword: hook.keyword,
text: hook.tags
});
[1]: https://i.stack.imgur.com/I0V08.png
我也有同样的问题。不幸的是,我不确定目前是否有解决办法