Forum Discussion

PreethaR's avatar
PreethaR
Occasional Visitor
2 years ago

Cucumber Feature - Duplicates

Hi,

 

I am just understanding the concepts of Cucumber and this question is bothering me.

Let us say - we have 10 members in a group associated with automating various scenarios for same module/application.

Member 1 writes

Feature 
Scenario: login with valid credentials
Given Launch the chrome browser
When browser opens the URL "XYZ.com"
And User enter login credentials Email as "admin@xyz.com" and Password as "admin"
And Click on Login
Then page title should be "Your store. Login"
And Close Browser

Member 2 writes feature

Scenario: successful login with vali credentials
Given user launches the chrome browser
When browser opens the URL "xyz.com"
And User enter login credentials Email as "admin@xyz.com" and Password as "admin"
And Click on Login
Then Page title should be "Welcome Admin"
When user clicks New Customer button
Then page title should be "New customer created"
And Close Browser

 

  1. My questions are
    1 - Notice the similarity between Member 1 and Member 2 - There is slight grammatical differences - how do we avoid this when we have large scale automation in 100s or 200s of features. ARe the tester required to go through existing step definition before writing a feature file?
  2. 2- There is slight addition to second member scenario - how can we maintain a library so that its easy to refer and write only what is newly required.

1 Reply

  • KB1's avatar
    KB1
    Champion Level 2

    To address the issues of consistency and maintainability in large-scale automation projects, it is important to follow some best practices when writing Cucumber feature files. Here are a few suggestions that may be helpful:

    1. Establish a clear style guide for writing feature files, and make sure that all team members are aware of and follow this style guide. This can help to ensure that feature files are written in a consistent and uniform manner, which can make them easier to read and understand. The style guide should include guidelines for things like grammar, formatting, and the use of terminology.

    2. Use a shared repository or library of step definitions and test data to ensure that common steps and test data are shared across different feature files. This can help to reduce redundancy and improve maintainability, as changes to common steps or test data only need to be made in a single location.

    3. Use version control tools, such as Git, to track changes to your feature files and step definitions. This can allow you to easily revert back to previous versions if needed, and can also help to identify any conflicts or issues that may arise when multiple team members are working on the same files.

    4. Consider using a test management tool to help you organize and manage your feature files and step definitions. Many test management tools have features that can help you organize and manage your test cases, such as the ability to group test cases into folders or use tags to filter and search for test cases.