Specflow for UI automation

386 Views Asked by At

For our project, TDD approach is followed by the developed team. But BA's write the user story in same format of example

AS AN : Anonymous Customer (ACUST) I WANT : to filter my search results by colour SO THAT : I can only see products in the colours I like

If BA's write user story in more generalized format, developers break the user stories into multiple stories. And our manual testers write test cases in Given-when-then form which is given to Automation tester (us) to automate.

We as a automation testers get SBI's having single test case associated to it.

Now we are using SpecFlow-Selenium to automate our test cases using PageObject pattern. and will be using MTM to associate test scripts to test cases and run them from MTM.

What should be our approach now to above scenario, How should we create our scenario and feature files in specflow?

Any information would be great.

1

There are 1 best solutions below

0
On

You should start from the happy scenario like: (you can also used "scenario outline" instead of "regular scenario")

Feature: filter results page of "Anonymous Customer"
         In order to help anonymous customers to find what their looked for
         As a anonymous customer I want be able to filter my search results   

BACKGROUND:
GIVEN i am an Anonymous Customer
AND i am at search results page

SCENARIO: customer filter results by color
GIVEN the page contains the following items:
         | product name | color | 
         | name1        | blue  |
         | etc....      | etc.. |
WHEN i filter results by <color X> (for example "blue")
THEN i should see the following items: <verify existence for the following items> 
         | product name       |
         | name1              |
         | other blue items...|

Then you can start check behavior of "bad scenario" only if they are Important (it depends on running time, money and etc.. ), for example:

scenario: customer change the filter color
scenario: customer remove all filters
scenario: etc...

Any way, from your description seems that the testers didn't break this story into the acceptance criteria