How to use the cypress-cucumber-preprocessor.when function in cypress-cucumber-preprocessor

To help you get started, we’ve selected a few cypress-cucumber-preprocessor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TheBrainFamily / cypress-cucumber-preprocessor / cypress / support / step_definitions / basic.js View on Github external
const { given, when, then } = require("cypress-cucumber-preprocessor"); // eslint-disable-line

given("a feature and a matching step definition file", () => {
  expect(true).to.equal(true);
});

when("I run cypress tests", () => {
  expect(true).to.equal(true);
});

then("they run properly", () => {
  expect(true).to.equal(true);
});
github TheBrainFamily / cypress-cucumber-preprocessor / cypress / support / step_definitions / scenario_outline.js View on Github external
const { when, then } = require("cypress-cucumber-preprocessor"); // eslint-disable-line

// you can have external state, and also require things!
let sum = 0;

when("I add {int} and {int}", (a, b) => {
  sum = a + b;
});

then("I verify that the result is equal the {string}", result => {
  expect(sum).to.equal(result);
});
github TheBrainFamily / cypress-cucumber-preprocessor / cypress / support / step_definitions / docString.js View on Github external
const { when, then } = require("cypress-cucumber-preprocessor"); // eslint-disable-line

let code = "";
// eslint-disable-next-line prefer-const
let variableToVerify = ""; // we are assigning this through eval

when("I use DocString for code like this:", dataString => {
  code = dataString;
});

then("I ran it and verify that it executes it", () => {
  // eslint-disable-next-line no-eval
  eval(code);
  expect(variableToVerify).to.equal("hello world");
});