1

I am starting to name my cucumber .feature files as VerifyLogin_JIRA-1211.feature

Is this the correct/optimum naming convention?

This question might get closed due to "opinion-based" but there is no place else, where I can ask questions about standard coding conventions.

Still, if it's not worth asking here, maybe direct me to some forums which have good naming conventions.

  • It's just a file name, Cucumber doesn't even take into consideration. If you and your team like it, go on. If you realize you don't, you can rename all at once with a simple regex. – João Farias Feb 26 at 22:20
1

I think feature files names should describe the functionality. The Cucumber Book uses user_logs_in.feature as a name for their first example. This gives the following domain information: The system has users and there is a login function.

If I open a folder with feature files I like it best if it gives me a general idea what the application does, e.g. what its features are. Having file names with words like Verify and Jira_Codes makes me feel you are using Cucumber as a testing tool and not a collaboration tool. It makes reading the names of the files more complex and does not really assist with understanding the domain.

I do understand the wish for traceability. I do not think one feature file maps to only one Jira-ticket or Specs-document. I started adding tags to features files to link them, for example, @SPECDOC-1211 and @TFS-123456 work items.

As I am writing this I think I would prefer to just add the traceability to the feature free text block. You can search for it, which seems good enough.

user_logs_in.feature
Feature: User logs in
    As a User,
    I want to be able to log in to the system,
    So that I can use its valuable features

    Implemented in JIRA-1211, JIRA-1231

Scenario: Valid credentials
Scenario: Registration

Reads:

| improve this answer | |
0

I guess it depends.

It is correct if it suits you and your team. And about being optimal also depends on the way you are structuring your tests.

If the workflow depends on a JIRA story, your example seems fitting and also provides traceability to JIRA issues.

In my previous workplace, I used to name the feature files according to functional specification's chapters and it worked for us.

| improve this answer | |
0

Definitely this question is opinion based. Recently I'm working on a project where client require the same way as you are asking to create our feature files. each feature file should have the Jira Ticket id along with the title.

e.g. AXMA-9204_Verify_x_functionality_working_fine_on_y_page.feature

And what i think is, Its very easy get the high level details about the particular scenario from project explorer itself without opening that file and read the description.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.