Every time you call scenario method a new scenario is being registered. Define scenarios in a loop to have dynamic scenarios based on provided data. package scenarios.concept import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* [1, 2, 3].each { number -> scenario("number $number") { println number } }
Use data/csv#list-of-map data.csv to conveniently build your scenarios from an external CSV data set. title, input, output hello, 10, 20 world, 30, 40 package scenarios.concept import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* data.csv.table('use-cases.csv').each { row -> scenario("use case ${row.title}") { println row.input println row.output } }
Use TableData if you want to derive data and/or have a convenience of collocating data and tests package scenarios.concept import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* def lever = 10 def useCases = ['title' | 'input' | 'output'] { ____________________________________ 'hello' | lever | lever + 10 'world' | lever + 30 | lever + 40 } useCases.each { row -> scenario("use case ${row.title}") { println row.input println row.output } }