Cached Value

When you develop tests, you don't have to restart the whole flow from the beginning.Imagine you have a multi step test that includes running Command Line tool and then validating REST API response, and then opening a browser to assert UI values.Cache long steps results like created entities ids to speed up tests development.In the example below, you create first scenario that runs a heavy command line tool that generates an id. We then cache the value and you can write a second scenario and keep re-running it, without the need to re-run the first one. import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* def createdId = cache.value("cli-heavy-created-id") // declare cached value with distinct id scenario("heavy setup operation") { def cliResult ="scripts/cli-heavy-process") // long running process that you don't want to re-run as you write your tests createdId.set(cliResult.extractFromOutputByRegexp("id=(\\S+)")) // caching the extracted id from CLI run } scenario("using previous setup id even after restart") { def id = createdId.get() // using cached value from previous test run. value will be preserved between restarts and re-compile http.get("/resource/${id}") { message.should == "hello" } } Note: Use groovy-standalone-runner/selective-run Selective Run or REPL/test-runs REPL mode to run one scenario at a time.