Using river to build a specflow + xUnit + selenium automatic function test environment for web pages

Time:2019-10-21
  1. Run rider, create test solution, select xUnit, and click create to create

 
  1. Import package: because I use Chrome browser (download the corresponding browser driver first), I import selenium.webdriver.chromeddriver package. When importing such package, the reader can keep the same with the browser he uses.

   Note: do not import packages with beta fields after them when importing packages

 
  1. Start to create test file (feature and test file correspond one by one)Create a feature file with. Feature as the suffix

 

Create a test file corresponding to the feature file. The result is as follows

 
  1. Write test code

 

 

 

 
  1. Operation result

 

A simple automated functional test project has been built.

Please go to the official website to learn about specflow grammar.