我正在为我的应用程序编写一些使用Cucumber和Selenium的端到端测试。我会按照Cucumber网站上的建议,让每个场景完全独立。但是,我的应用程序有基于会话的身份验证,所以每次运行新场景时,它都需要一个登录过程才能首先访问站点。现在,我的方法是将登录场景作为所有其他场景的后台场景,如下所示:
Background: User is Logged In
Given I am on the login screen
When I enter my login details
And I click submit
Then I should be log