bencompton / jest-cucumber

Execute Gherkin scenarios in Jest
Apache License 2.0
662 stars 118 forks source link

scenarioNameTemplate option is not working with scenario outline #138

Closed dartyuhov closed 7 months ago

dartyuhov commented 3 years ago

Hello, I've noticed that 'scenarioNameTemplate' option is not processing scenarios name if those scenario were defined as Scenario Outline

runner.js: (add tags to the scenario name name)

import steps from '@logic/stepDefinitions';
import { autoBindSteps, loadFeatures } from 'jest-cucumber';

const features = loadFeatures('**/features/*.feature', {
  scenarioNameTemplate: (vars) => `${vars.scenarioTags} ${vars.scenarioTitle}`,
});

autoBindSteps(features, steps);

feature:

@tag
Scenario Outline: Some test
  Given: Bla bla <param>

  Examples: 
   | param |
   | 1          |
   | 2          |

@tag2
Scenario: Some test 2
  Given: Bla bla 1

scenarios names would be:

norbertpeity commented 2 years ago

I encountered the same problem, and tried the solution from this PR, and it looks like it fixes the issue: https://github.com/bencompton/jest-cucumber/pull/144

github-actions[bot] commented 7 months ago

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] commented 7 months ago

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