我尝试使用以下说明配置Cypress 12与Cucumber:https://testersdock.com/cypress-cucumber-bdd/
有人在这方面取得了成功吗?我一直得到恒定的错误和柏树不会运行我的功能文件。我想我可能需要回到赛普拉斯10号才能让这个工作。多谢。
在cypress 12中,您应该将预处理器与spectPattern
一起添加到cypress.config.js
文件中,这样您就可以使用cucumber了:文档→https://docs.cypress.io/api/plugins/preprocessors-api
const { defineConfig } = require("cypress");
const cucumber = require('cypress-cucumber-preprocessor').default;
module.exports = defineConfig({
e2e: {
baseUrl: 'https://jsonplaceholder.typicode.com',
specPattern: '**/*.feature',
setupNodeEvents(on, config) {
on('file:preprocessor', cucumber())
// implement node event listeners here
},
},
});