2011-12-07 311 views
0

我们只是说我有一个场景,我测试注册。在黄瓜堆积测试

在那之后,我想,也许测试大量的其他功能作为登录的用户,注销,登录为不同的用户,等等等等

这意味着我已经设置了一个整体一系列行动;我应该每次重新运行我的注册测试吗?我应该如何组织我的步骤/功能?

回答

0

1)考试报名“是通过”沿途测试的其他功能一堆一次

之后,创建一个用户,然后通过你的登录功能:

Given a user exists with email: "[email protected]" 
When I go to the homepage 
When I follow "Sign in" 
When I fill in "Email" with "[email protected]" 
When I fill in "Password" with "password" 
When I press "Sign in" 

<<rest of functionality test>> 

2)你可以在后面的步骤凝结那些迹象只是

When I sign in as "[email protected]" 

和重用他们对于其他测试

见:https://github.com/cucumber/cucumber/wiki/Calling-Steps-from-Step-Definitions

2)如果其他功能的一群背后认证,你必须测试你的登录功能

3)回来到您的注册功能,并做出特色和/或每种变体的注册情况(已发送的电子邮件等)。之后您不需要继续测试一堆功能,只需检查注册是否奏效即可。我的测试通常这样说

The I should see "Dashboard" 

这表明在注册/请登录成功