How to use the cucumber.When function in cucumber

To help you get started, we’ve selected a few cucumber 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 canvaspixels / courgette / uiTestHelpers / mobileStepDefinitions / commonWhenSteps.js View on Github external
steps.forEach((step) => {
    const matchPattern = "([^']*)?";
    const matcher = step.matcher
      .replace(new RegExp(`(${placeholders.join('|')})`, 'g'), matchPattern);

    When(new RegExp(`^${matcher}$`), {}, require(step.path));
    step.regex = new RegExp(`^${matcher}$`); // eslint-disable-line no-param-reassign
  });
}

cucumber

The official JavaScript implementation of Cucumber.

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis