无法运行 Cypress Cucumber 测试。收到奇怪的 Gherkin 错误

Cas*_*ing 2 cypress cypress-cucumber-preprocessor

当我尝试使用 @badeball/cypress-cucumber-preprocessor 与 Cypress 运行黄瓜测试时,我收到这个奇怪的错误:在此输入图像描述

这表明错误来自我的duckduckgo.feature文件,如下所示:

Scenario Outline: Steps will run conditionally if tagged
  
  When user visits <site>
  Then <site> search bar will display

  @google
  Examples:
    | site                  |
    | google.com            |

  @duckduckgo
  Examples:
    | site                   |
    | duckduckgo.com         |
Run Code Online (Sandbox Code Playgroud)

这是我的cypress.config.js文件:

const { defineConfig } = require("cypress");
const preprocessor = require("@badeball/cypress-cucumber-preprocessor");
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify");

async function setupNodeEvents(on, config) {

  await preprocessor.addCucumberPreprocessorPlugin(on, config);
  on("file:preprocessor", browserify.default(config));

  return config;
}

module.exports = defineConfig({
  e2e: {
    specPattern: "**/*.feature",
    setupNodeEvents,
  },
  
});
Run Code Online (Sandbox Code Playgroud)

似乎赛普拉斯无法识别我的步骤定义或我的测试,但我不确定为什么。直到几天前,一切都运转良好。我尝试过使用其他捆绑器,但没有成功。有点只是插入随机的东西并在这一点上祈祷。任何人都可以破译这个错误吗?

如果你想修改它,这里是 repo。

Val*_*iia 5

您的功能文件应该以“功能:”+功能名称开始。我建议您使用功能格式化程序之一,它将根据标准格式化功能文件(功能语法突出显示和片段、功能文件、BDD - 功能编辑器等)