bdd – Writing behavioural features/scenarios for application with many proccesses and sections

I’m trying to start automation on the web application that I’m currently manually testing. I was suggested to do it using BDD, so I started reseaching about it, and as I started writing my first features, I realized that there is just too much and I am getting overwhelmed.

My application was has like 10 menu items each one being a business unit, the one that I’m testing has like 9 – 10 sub menu items (screens) that resemble each a process of my business unit, and due to code reutilization, many of the screens I’m testing share components with other business units, so there were some bugs due to changes “out of my backlog”, that’s why I would like to test screen data validations. Also each screen has at least 3 – 7 sections (the sections shown depend on the data input) and each element of each section has different validations. Finally all the proccesses start with the same one, but some of then require more than two or three proccesses previously done.

Which should be my approach?

a) Should I try to write the features focusing the validation of each section separatedly? And at some point automate the full happy path of the process?

b) Or maybe I should stay into the general “flow” and write like i’m trying to do the whole process itself each time? Having tons of scenarios where I end the flow earlier because of the testing of the different validations?

Examples of what I thought: Suppose the first process of all, the test creation process, there you can create tests, you have for example, type STANDARD and type SPECIAL tests, type SPECIAL displays an additional section. Also for simplification SA => Section A. Parenthesis will be set of data for current section and type of test, so SA(STANDARD) will be the set of data for section A for a Standard Test.

   Background:
          Given I am in creation page

a) Feature: As A user I want to be able to create my tests
      Scenario: Completing SA with correct values
          When I complete with correct SA(STANDARD) values
          Then validation goes ok
          And SC is shown

      Scenario: Completing SA with correct values
          When I complete with correct SA(SPECIAL) values
          Then validation goes ok
          And SB is shown
          And SC is shown

      Scenario: Completing SA with incorrect values
          ... ... ... -> page validations

      Scenario: Partially completing SA 
          ... ... ... -> other page validations

      Scenario: Completing SC with correct values
          Given I completed SA with correct SA(STANDARD) values
          And SB and SC are shown
          When I complete SC with correct SC(STANDARD) values
          ... ... ...
     #And at some point I will automate the "happy path", well the happy path could be at the beginning though

b) Feature: As A user I want to be able to create my tests
      Scenario: Correct Creation of a STANDARD test
          When I complete SA with correct SA(STANDARD) values
          And I complete SC with correct SC(STANDARD) values
          And I create the test
          Then the test is created successfully

      Scenario: Correct Creation of a SPECIAL test
          When I complete SA with correct SA(SPECIAL) values
          And I complete SC with correct SC(SPECIAL) values
          And I complete SB with correct SB(SPECIAL) values
          And I create the test
          Then the test is created successfully

      Scenario: Attempting the creation of a STANDARD test with incorrect SA(STANDARD) values
          Given I am in creation page
          When I complete SA with incorrect SA(STANDARD) values
          And I create the test
          Then the test is not created
          And the screen shows validation errors on 

      Scenario: Attempting the creation of a STANDARD test with incorrect SB(STANDARD) values
          Given I am in creation page
          And I completed SA with correct SA(STANDARD) values
          When I complete SB with incorrect SB(STANDARD) values
          And I create the test
          Then the test is not created
          And the screen shows validation errors

Well, I know I wrote too much, I was trying to show what I’ve been thinking. Any help or suggestion is much appreciated.

Leave a Comment