【发布时间】:2018-04-11 05:59:22
【问题描述】:
在我们的 Web 应用程序中,登录某个页面需要年龄。我们的功能和场景集是从该特定页面编写的。我们在该页面之前没有任何验证。大约需要 10 分钟才能到达该页面。
在我进一步解释之前。这是在 Cucumber 中,我们使用 Selenium 和 Java。
所以应该完成登录操作,并且 webdriver 会话应该保持不变,然后场景验证开始。以下功能具有以下场景。每个后续场景都依赖于前一个场景。这意味着,这些场景需要按顺序执行。
第一个功能应该按顺序执行场景。 然后第二个功能应该按顺序执行场景。 在这两者之间,我不希望为第二种情况创建一个新会话。 这些都是顺序依赖的。
我该如何实现?
Feature: Add a product to the quote
So that the quotation can be built on the added product
Scenario: Add a Hub
Given User A has logged in
Then Add button is available
Then Add Hub
Then Enter correct Address details
Then select correct bandwidth
And Save to Quote
Scenario: Add a Spoke
Given User A has logged in
Then Add button is available
Then Add Spoke
Then Enter correct Address details
Then select correct bandwidth
And Save to Quote
Feature: Give discount to the quote for Hub
So that the quotation can be sent to the customer
Scenario: Give 10% discount
Given Hub has already been added
Then Go to the Quote Tab
Then Enter the discount
Then Save the Quote
【问题讨论】:
标签: java selenium frameworks cucumber pageobjects