cucumber repeat substeps in a feature file

最后都变了- 提交于 2019-12-12 03:56:16

问题


I have to run a feature file with multiple cases in a single login. For ex:

Scenario: check total When user logs in with "username" and "password" And user checks for "" on "" And user checks for "" on ""

Examples:

| username | password | amount1 | date1 |amount2|date2|... some 20 entries..

I need to check for amount on date in a single login,while in my scenario it is login each time for every entry in data table.How do I achieve it?

Instead I want something like this:
When user logs in with "username" and "password"

Examples:
|username|password| ..use it only once And user checks for "amount" on "date"

Examples:

|amount|date|....loop over 20 times


回答1:


After some research,I have found an answer to this.Just give a datatable after that step,and take datatable as argument in the corresponding java method and iterate over it.



来源:https://stackoverflow.com/questions/44044604/cucumber-repeat-substeps-in-a-feature-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!