top of page
  • Writer's picturekhyati sehgal

Was unable to find a step for “”: Mapping stepDefinitions to feature file in cucumber

Was unable to find step for “Given open application as admin user”cucumberautocomplete

While working with cucumber, when steps are not mapped completely with the feature files, it usually gives this as a warning.

In this blog, I will share how can we map the step definition with the feature files.

How does the feature look like?

unimplemented_methods

unimplemented_methods

But I already have a step defined for this, then why this error is coming?

These steps will help you in resolving this error.

  1. Add Cucumber extension

  1. In protractor configuration file, in require block add the path of step definitions like this:-

  require: [
            './e2e/hooks/*.ts',
            './e2e/stepDefinition/*/*.ts',
        ],
 

hooks

No changes in hooks file
 

Settings.json

Check the settings.json

js

Settings.json

  1. File –> Preference

  2. Search for keyword- ‘js’

  3. Click setting.json

  4. Add the correct path of the steps, feature file here.

 {
        "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
        "html.format.indentHandlebars": true,
        "html.format.indentInnerHtml": true,
  "typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true,
        "typescript.implementationsCodeLens.enabled": true,
   javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true,
        "typescript.format.insertSpaceAfterConstructor": true,
        "typescript.format.insertSpaceAfterTypeAssertion": true,
        "typescript.updateImportsOnFileMove.enabled": "always",
        "files.autoSave": "afterDelay",
        "terminal.integrated.fontWeight": "800",
        "terminal.integrated.scrollback": 10000,
        "editor.wordWrapColumn": 300,
        "html.format.wrapLineLength": 300,
        "editor.wrappingIndent": "none",
        "editor.formatOnPaste": true,
        "html.format.endWithNewline": true,
        "html.format.maxPreserveNewLines": 300,
        "editor.wordWrap": "on",
        "cucumberautocomplete.steps": [
            "e2e/stepDefinition/*/*.ts"
        ],
        "cucumberautocomplete.syncfeatures": "e2e/features/*/*.feature",
        "cucumberautocomplete.strictGherkinCompletion": true,
        "window.zoomLevel": 0,
        "cucumberautocomplete.strictGherkinValidation": true,
        "editor.renderWhitespace": "none",
        "editor.renderControlCharacters": true,
        "launch": {
      
        },
        "workbench.iconTheme": "vscode-icons"
    }
 

And you are done

615 views0 comments

Recent Posts

See All
bottom of page