This section contains NUnit notes
The main point of this site is that Selenium, Specflow, Gherkin and NUnit work like a hand in a glove. Together they ensure your automation efforts in Selenium give you the maximum return on your investment.
Nunit notes to follow.
NUnit Console runnerOverview
The console runnier is how the testers, developers, BA etc can run the automation tests without having access to Visual Studio. It is also how we divide the tests up into chunks that fit business and individual needs.
The NUnit code can be downloaded from www.nunit.org to run automation tests. I store this code on a network drive along with my modified batch files. Anyone wanting to run the code can just copy this directory to their local machine and run the batch files. Updated test can just be downloaded with a drag and replace.
Specflow feature files enable you to give a number of tags to each scenario for example:-
In order to enter the amount of items needed
As a customer
I want a field that enables me to enter the number
@R1S1All @R1S1Fast @R1All @R1Fast
Given I open the application
Each Specflow Gherkin feature file should have a scenario that runs a test that matches the acceptance criteria. In the Feature: extract above each tag word follows the @ sign. This example shows four tags R1S1All, R1S1Fast, R1All R1Fast. You can make your own naming conventions based on your project. The idea is that you can select tests to run based on the tag. The idea is that it is Release 1 Sprint 1. The R1All is tagged against every test, the R1Fast is just a subset that would do boundary and equivalence analysis rather than bruit force. The idea is that when your developer checks in the code they can just run the Fast tests for a quick confirmation and when they go to lunch they could run all the tests. You could have tags based on section of the application for example screen 1 and screen 2. The tags are listed in the Gherkin dictionary. Record the tag, the number of tests, the time to run and the reason for the tag. (See Gherkin Dictionary for examples) This way anyone in your company can download the Console runner to their local directory. Run the batch file that matches the Tag they are interested in then sit back and watch the tests run. If your developer checks in their code before lunch then they could run the R1Fast batch file and after lunch be confident they have no regression issues. The Developer could run the R1All overnight and have regression feedback when they get in next morning. Passing the ability to rest out to developers, BA, Product Owners, Support etc will have a major impact on your business in terms of quality and confidence.
Batch filesA company network share contains the nunit3 console runner code and your specflow dll in your application sub directory. (Details in Specflow section on this). It also contains batch files with names that match your tags. Let’s take the R1All tag. In this console runner directory, you will have a file called R1All.Bat and in this file you will have a single line that follows:-
nunit3-console.exe4 ".\apptestdirectory\apptestname.dll" -where "cat==R1All"
That is all there is too it. Now when someone runs the batch file then all the tests marked with the tag R1All will run.