Incremental Tests Development

You can combine experimentation in REPL with actual test development. Your feedback loop becomes even faster:Try API Add the line to test Re-run test with REPL Experiment within preserved context Enumerate test files you want to REPL with and add repl to get into incremental tests development mode webtau testscipts/* repl

Test Files Listing

Use ls command to list available test files. webtau:000> ls Test files: 0 testscripts/dataDownload.groovy 1 testscripts/downstreamValidation.groovy 2 testscripts/resourceCreation.groovy Note: Listing will happen automatically at the start

Test File Selection

webtau:000> s 0 Test scenarios of testscripts/dataDownload.groovy: 0 clean data 1 download data 2 validate data webtau:000> b Test files: 0 testscripts/dataDownload.groovy 1 testscripts/downstreamValidation.groovy 2 testscripts/resourceCreation.groovy webtau:000> s 'datadownload' Test scenarios of testscripts/dataDownload.groovy: 0 clean data 1 download data 2 validate data

Single Test Scenario Run

Selected test file has three scenarios package testscripts import static org.testingisdocumenting.webtau.WebTauGroovyDsl.scenario scenario("clean data") { println "cleaning..." } scenario("download data") { println "downloading..." } scenario("validate data") { println "validating..." } To run scenario by index webtau:000> r 0 before first test (Setup) [.] before first test (Setup) running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy) To run scenario by partial name match webtau:000> r 'clean' running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy)

Re-run Last Run

Use r to re-run previous run webtau:000> r running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy)

Multiple Test Scenarios Run

Use comma separated list of indexes or partial text match to run more than one scenario webtau:000> r 0, 1 running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy) running: testscripts/dataDownload.groovy download data download data (dataDownload.groovy) downloading... [.] download data (dataDownload.groovy) webtau:000> r 'download', 'clean' running: testscripts/dataDownload.groovy download data download data (dataDownload.groovy) downloading... [.] download data (dataDownload.groovy) running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy) Note: Order of execution follows the order of specified indexes or textUse r from:to to run a range of scenarios. From , to can be either index or partial text match. webtau:000> r 0:'validate' running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy) running: testscripts/dataDownload.groovy download data download data (dataDownload.groovy) downloading... [.] download data (dataDownload.groovy) running: testscripts/dataDownload.groovy validate data validate data (dataDownload.groovy) validating... [.] validate data (dataDownload.groovy) webtau:000> r 'validate':0 running: testscripts/dataDownload.groovy validate data validate data (dataDownload.groovy) validating... [.] validate data (dataDownload.groovy) running: testscripts/dataDownload.groovy download data download data (dataDownload.groovy) downloading... [.] download data (dataDownload.groovy) running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy)

Select Scenarios Without Run

package testscripts import static org.testingisdocumenting.webtau.WebTauGroovyDsl.scenario scenario("clean data") { println "cleaning..." } scenario("download data") { println "downloading..." } scenario("validate data") { println "validating..." } Lets run scenarios by ranage again webtau:000> r 'validate':0 running: testscripts/dataDownload.groovy validate data validate data (dataDownload.groovy) validating... [.] validate data (dataDownload.groovy) running: testscripts/dataDownload.groovy download data download data (dataDownload.groovy) downloading... [.] download data (dataDownload.groovy) running: testscripts/dataDownload.groovy clean data clean data (dataDownload.groovy) cleaning... [.] clean data (dataDownload.groovy) Use s to display last ran or selected scenarios. These scenarios will be ran with r webtau:000> s Selected scenarios: validate data download data clean data webtau:000> s 0,2 Selected scenarios: clean data validate data