【发布时间】:2019-09-30 10:09:08
【问题描述】:
我想连接 Cypress 和 Cucumber,我找到了以下插件:https://www.npmjs.com/package/cypress-cucumber-preprocessor
但是我的实现不起作用并且找不到。我还将插件添加到plugins/index.js 文件夹中。
cypess/integration/test.feature
Feature: Background Section
Background:
Given counter has been reset
Scenario: Basic example #1
When counter is incremented
Then counter equals 1
Scenario: Basic example #2
When counter is incremented
When counter is incremented
Then counter equals 2
cypess/integration/test.js
let counter = 0;
Given("counter has been reset", () => {
counter = 0;
});
When("counter is incremented", () => {
counter += 1;
});
Then("counter equals {int}", value => {
expect(counter).to.equal(value);
});
cypess/plugins/index.js
// Cucumber Plugin
const cucumber = require('cypress-cucumber-preprocessor').default
module.exports = (on, config) => {
on('file:preprocessor', cucumber())
}
错误
【问题讨论】:
-
自己做的。请参阅
https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/issues/126的 jogelin 回答
标签: javascript angular typescript cucumber cypress