我有以下功能文件。我在运行时获得了一组批处理名称的值,我想将新的批处理名称添加到示例表行中。如果在运行时找到批处理名称,则该数字会有所不同。
要求:根据我在BeforeTestRun中执行的代码期间获得的批处理名称重新运行此方案。
Scenario Outline: Verify captured document values against CMS for
Given user is in QueueHandling home page Dashboard
And user has batches assigned to himself/herself
When user selects "<batchName>" batch from batch list
Then selected batch is opened in a new window
And user views all identified documents
When user selects "Settlement Coversheet" document and compare data
When user selects "AssetLoanAgreement" document and compare data
Given user navigates back to QueueHandling home page Dashboard
Examples:
| batchName |
| QGOL2B |
| QGK3UB |
最简单的方法是从方案中删除批次名称,并停止使用方案大纲。
您当前的方案只与用户如何做有关,方案应与用户在做什么有关。如果采用这种方法,则会得到更简单明了的方案,并将HOW推入步骤定义中,或者更好地将其引入步骤定义所调用的辅助方法。
我只能推测您在这里所做的事情,因为您的情况还不是很清楚,但是希望它足以使您入门。]
Scenario: User checks their batches Given the user has a new set of batches When the user checks their batches Then ... # user_batch_checking_steps --------------------- Given 'user has a new set of batches' do @batches = load_batches end When 'the user checks their batches' do @results = {} @batches.each do |batch| @results << check_batch(batch: batch) end end module BatchStepHelper def load_batches # here is where you make a call to retrieve you list of batches end def batch(batch: ) # here is where you do all your interactions to check you batch
这将使所有编程(操作方法)从黄瓜中剔除,然后将其下推,因此最终以您的编程语言出现,您可以在其中使用工具来执行诸如检索批次列表的操作。