简体   繁体   中英

Specflow 2022 Generate a Step Definition file - VSC BDD: All steps have been defined in this file already

Just downloaded the latest version of VSC and Specflow (2022). For my training course.

I've created as simple customer registration BDD script

I have the correct Nugget packages installed but I am unable to see the "Generate Step Definitions" when I right click.

I'm trying to create a step definition I keep getting the following error

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

This is how to resolve this issue

  1. Right click at the project level - THIS IS MY PROJECT

  2. Select Add new item 3 Add SpecFlow Configuration File

  3. Delete what is that JSON file

  4. Paste this code into the config file instead

    { "language": { "feature": "en-nz" } }
  5. Go into feature file and Right click a step

  6. Select Define Steps option

  7. Go through the define steps wizard

  8. The step definition file will be generated

  9. Add to the step definitions folder

  10. To double check select step, right click and select ' go to definition '

  11. You should be taken to the step definition file step you've selected.

I had this same issue.

You have to build the solution (ctrl+shift+B) or the project (ctrl+B) first. Then try define steps again.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM