1
votes

I am new to TDD/BDD and have started a new MVC4 application (I'm new to MVC also) and am trying to work out the steps I need to follow to get myself into all this TDD/BDD mindset.

I have installed Specflow and created a simple feature, view contact. In my feature steps I have a method decorated with BeforeScenario attribute to set up a new datacontext for me to use in my features. In my given I create a contact and add to my datacontext and save.

In my When step I want to navigate to my Client view and in my Then step I want to assert that the client I have create in my Given is displayed on screen.

How can this be done with Specflow as my limited understanding is that I cannot interact with the browser with specflow????

Cheer for any help.

3

3 Answers

1
votes

I would recommend using Coypu to interact with the web browser using Specflow.

Coypu is a web driver abstraction i.e. instead of using a specific web driver (e.g. Selenium) you can write web driver agnostic code and then choose the web driver which this code should use (e.g. Selenium, Waitn, PhantomJS HEAD-less browser etc.)

0
votes

To interact with the browser, check out Selenium WebDriver.

Here is another resource with a "get-started" guide.

0
votes

I found Gojko Adzic's material quite good for this. Have a look at cuke4ninja for some really good insights (esp. look at the web automation stuff).