Skip to content
\n

VS

\n
When I visit :content_type content page with title :title\n
\n

I maintain a library of Behat steps and currently is in the process of formalising the \"language\".

\n

I would really appreciate some direction please.

\n

Thank you

","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"

@AlexSkrypnyk that's a good question...

\n

I think it slightly depends on the domain? I think these mean different things:

\n\n

So personally I would probably want to be explicit about that. But whether to use a or the depends on the step, for example (thinking quickly):

\n
Given no existing pages\nAnd \"Brian\" creates a page with:\n  | title     | Widgets |\nWhen I visit the page with the title \"Widgets\"\nThen I should see that Brian authored the page
\n

I also think if the goal is \"natural language\" specifications then the article is usually necessary to make the sentence read correctly?

","upvoteCount":1,"url":"https://github.com/Behat/Behat/discussions/1621#discussioncomment-12838799"}}}

Should I use the/a/an when writing steps #1621

Answered by acoulton
AlexSkrypnyk asked this question in Q&A
Discussion options

You must be logged in to vote

@AlexSkrypnyk that's a good question...

I think it slightly depends on the domain? I think these mean different things:

  • When I visit the {whatever} content page with title :title (implies it is unique, presumably created earlier in the feature, probably the step should fail if finds 0 or 2, to avoid false positives / data bleeding between scenarios)
  • When I visit a {whatever] content page with title :title (implies the only thing that matters is the title, and there may be multiple pages with that title)

So personally I would probably want to be explicit about that. But whether to use a or the depends on the step, for example (thinking quickly):

Given no existing pages
And "Brian" create…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by acoulton
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1616 on April 15, 2025 08:21.