1

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 Answers 3

1

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.)

Sign up to request clarification or add additional context in comments.

Comments

0

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).

2 Comments

re: Fresh - Surreal, isn't it? It's fairly recent, I remember when it was a site about BDD presented via ninja... but maybe they refocused their efforts? That or it's a really odd hack, I truly have no idea. Does anyone know?
The site got taken down. Luckily it was moved to github. lmgtfy
0

To interact with the browser, check out Selenium WebDriver.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.