jest-cucumber icon indicating copy to clipboard operation
jest-cucumber copied to clipboard

The autoBindSteps could not see the Scenario Outline with <variables>

Open dizzyn opened this issue 4 years ago • 3 comments

If I use such am outline scenarios:

image

I can reach them by regular step definitions:

 test('Exporting all localizations (<Localization_name> - <Export_type> translation strings)', async ({given, and}) => {
        given('User is on Localization page', userIsOnLocalizationPage);

        and('User has all localizations present', async () => {

BUT I can not reach them by the autoBindSteps( this is the error report: image

Thank You

dizzyn avatar Dec 02 '20 11:12 dizzyn

@dizzyn you should check out cucumber-jest. It a jest transformer that allows you to use the cucumber api with jest. It provides all the benefits of executing cucumber tests with jest, without a custom api.

mainfraame avatar Dec 05 '20 21:12 mainfraame

Thanks for this awesome library! I am experiencing the same issue. Is there an estimated timeline for a fix?

cabillin avatar Jun 23 '21 00:06 cabillin

For everyone in need for a quick fix, I did this and it works for me:

[...]
const features = loadFeatures('e2e/features/**.feature').map((feature) => {
  feature.scenarioOutlines.forEach((outline) => {
    feature.scenarios.push(...outline.scenarios);
  });
  feature.scenarioOutlines = [];
  return feature;
});

autoBindSteps(features, [mySteps]);
[...]

Basically this promotes a scenario outlines' computed sub-scenarios to top-level scenarios and removes the scenario outlines from the internal feature definition. I did not see any drawback. Yet.

thlcodes avatar Feb 25 '22 13:02 thlcodes

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 08 '24 02:04 github-actions[bot]

This issue is closed because there has been no recent activity.

github-actions[bot] avatar Apr 15 '24 04:04 github-actions[bot]