Runners

To run webtau tests you have a few options: #groovy-runner Standalone Groovy Runner #junit5 JUnit5 #junit4 JUnit4

Groovy Runner

If you have https://brew.sh brew installed in your system use brew install testingisdocumenting/brew/webtau Alternatively, download and unzip https://repo.maven.apache.org/maven2/org/testingisdocumenting/webtau/webtau-dist/1.35/webtau-dist-1.35-webtau.zip webtau. Add it to your PATH . webtau --example Navigate into todo example cd examples/todo import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* scenario('fetch todo item') { http.get('/todos/1') { title.should == 'delectus aut autem' completed.should == false } } To run test webtau todolist.groovy --url=https://jsonplaceholder.typicode.com Note: using import is optional and is mainly for IDE auto completion. Imports are added implicitly during command line run. To integrate CLI run into maven build use: <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-groovy</artifactId> <version>1.35</version> </dependency> <plugin> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-maven-plugin</artifactId> <version>1.35</version> <executions> <execution> <phase>test</phase> <goals> <goal>run</goal> </goals> </execution> </executions> <configuration> <workingDir>${project.basedir}/src/main/groovy</workingDir> <env>integration</env> <url>http://optional-base-url</url> <tests> <directory>${project.basedir}/src/main/groovy</directory> <includes> <include>scenarios/simple*.groovy</include> </includes> </tests> </configuration> </plugin> groovy-standalone-runner/introduction Learn more about Groovy Runner features

JUnit5

Groovy <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-groovy</artifactId> <version>1.35</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit5</artifactId> <version>1.35</version> </dependency> package com.example.tests.junit5 import org.junit.jupiter.api.Test import org.testingisdocumenting.webtau.junit5.WebTau import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* // convenient single import for all things webtau @WebTau // annotation required for reports generation class JUnit5ExampleGroovyTest { @Test void "my test"() { } } Java <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau</artifactId> <version>1.35</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit5</artifactId> <version>1.35</version> </dependency> package com.example.tests.junit5; import org.junit.jupiter.api.Test; import org.testingisdocumenting.webtau.junit5.WebTau; import static org.testingisdocumenting.webtau.WebTauDsl.*; // convenient single import for all things webtau @WebTau // annotation required for reports generation public class JUnit5ExampleJavaTest { @Test public void myTest() { } }

JUnit4

Groovy <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-groovy</artifactId> <version>1.35</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit4</artifactId> <version>1.35</version> </dependency> package com.example.tests.junit4 import org.junit.Test import org.junit.runner.RunWith import org.testingisdocumenting.webtau.junit4.WebTauRunner import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* // convenient single import for all things webtau @RunWith(WebTauRunner.class) // webtau runner to generate reports class JUnit4ExampleGroovyTest { @Test void "my test"() { } } Java <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau</artifactId> <version>1.35</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit4</artifactId> <version>1.35</version> </dependency> package com.example.tests.junit4; import org.junit.Test; import org.junit.runner.RunWith; import org.testingisdocumenting.webtau.junit4.WebTauRunner; import static org.testingisdocumenting.webtau.WebTauDsl.*; // convenient single import for all things webtau @RunWith(WebTauRunner.class) // webtau runner to generate reports public class JUnit4ExampleJavaTest { @Test public void myTest() { } }