Skipping Tests on Condition

Use onlyWhen if you need to skip tests based on a condition. package scenarios.concept import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* String emailHost = cfg.emailHost onlyWhen('email server is internal', { -> emailHost.contains('internal.server')}) { scenario('confirmation emails should be sent') { // ... http.get(emailHost) { subjects.should contain('my message') } } } Tests will still appear as part of your report but will be marked as skipped.

Skipping Tests Based on Env

Use onlyForEnv shortcut if you need to skip tests for certain environment. package scenarios.concept import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* onlyForEnv('experimental') { scenario('this scenario will only be executed in "experimental" env') { http.get('/new-endpoint') { price.shouldBe > 0 } } }

Custom Shortcuts

Consider creating your project specific shortcuts to avoid boilerplate. Here is an example of onlyForEnv shortcut definition. static void onlyForEnv(String env, Closure registrationCode) { onlyWhen("only for <$env> environment", { -> getCfg().getEnv() == env }, registrationCode) }

Unconditionally Skipping Tests

Instead of scenario , use dscenario or disabledScenario to always skip a test. This is analogous to Junit's @Ignore or @Disabled . package scenarios.concept import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* dscenario('do not execute this scenario') { http.get('/new-endpoint') { price.shouldBe > 0 } } disabledScenario('do not execute this scenario either') { http.get('/new-endpoint') { price.shouldBe > 0 } }