开发者

test a multi-step registration system using SpecFlow

开发者 https://www.devze.com 2023-04-10 20:48 出处:网络
I\'m using SpecFlow whilst writing an asp.net mvc 3 website. The registration system in the site consists of two views.

I'm using SpecFlow whilst writing an asp.net mvc 3 website. The registration system in the site consists of two views. the first view asks for basic information e.g eMail, password and location, whilst the second view asks the user for the type of account (developer or standard user) and then name, address etc.

In SpecFlow terms then I have one feature Registration and two succeeding senarios, registering as a developer and as a standard user. if this was one view I could test this using something like: given I am on the registration page when I enter Data1 and I enter data2 and I click the next bu开发者_JS百科tton then the registration should be successfull as I have two views is it best practice to chain several given, when, and, then statements or is there a better way of doing something like this? Any help apreciated. Sean


I would avoid mentioning the different pages within the feature file, and handle that at the step definition level instead, e.g.

Given I am registering
When I fill in my basic information
And I choose to register as a developer
Then I should be registered as a developer

Given I am registering
When I fill in my basic information
And I choose to register as a standard user
Then I should be registered as a standard user
0

精彩评论

暂无评论...
验证码 换一张
取 消