How do I check whether a step already exists before I write another one?
Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.
Third proposal in a row bounced with "this step already exists in a different phrasing". Fair enough, but I am clearly missing whatever everyone else is looking at, because I did search the repository for the phrase before writing it.
What is the actual way to see everything a project can already say?
Grepping the repository will not find them, because most of what a project can say ships in the core library rather than in your project folder. Ask the project instead:
bash
sdods steps list -p demo-shop
bash
sdods steps list -p demo-shop --grep cart
That is the shared library plus your project steps plus your decorated page-object methods, as the generator sees them. It is also exactly what the editor's step catalogue is built from, which is the version I use day to day because it sits next to the file I am editing:
the step catalogue is the same list steps list prints
Two more that help when the phrasing exists but you cannot remember where:
Running steps list --grep before writing anything was the single practice that kept our migration from producing a step per spec. We came out with a vocabulary of about a dozen project steps on top of the shared ones, which is roughly what a person can hold in their head.
When nothing fits and you do have to add one, copy the phrasing style of its nearest neighbour. I click the "Delete" button and When I press Delete doing the same thing is how a step list becomes unsearchable.
If you are driving this through an agent rather than by hand, the same catalogue is exposed over MCP as step_list and step_find, and feature_list for the features side. Worth wiring up, because an agent that cannot see the existing vocabulary invents a new one every time.