Runners
To run WebTau tests you have a few options: #groovy-runner Standalone Groovy Runner #junit5 JUnit5 #junit4 JUnit4
To run WebTau tests you have a few options: #groovy-runner Standalone Groovy Runner #junit5 JUnit5 #junit4 JUnit4
If you have https://brew.sh brew installed in your system use brew install testingisdocumenting/brew/webtau If you have https://sdkman.io sdkman installed in your system use sdk install webtau Alternatively, download and unzip https://repo.maven.apache.org/maven2/org/testingisdocumenting/webtau/webtau-dist/2.4/webtau-dist-2.4-webtau.zip WebTau. Add it to your PATH .Note: WebTau installed manually requires Java 17+ to be present in 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>2.4</version> </dependency> <plugin> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-maven-plugin</artifactId> <version>2.4</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> <config>optional-config-file-name-override.cfg.groovy</config> <reportPath>optional-report-path-override.html</reportPath> <failedReportPath>optional-failed-report-path-override.html</failedReportPath> <reportName>my service</reportName> <reportNameUrl>https://service-under-test</reportNameUrl> <noColor>false</noColor> <tests> <directory>${project.basedir}/src/main/groovy</directory> <includes> <include>scenarios/*.groovy</include> </includes> </tests> </configuration> </plugin> groovy-standalone-runner/introduction Learn more about Groovy Runner features
Groovy <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-groovy</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit5</artifactId> <version>2.4</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>2.4</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit5</artifactId> <version>2.4</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() { } } junit5/getting-started Learn more about JUnit5 features
Groovy <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-groovy</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit4</artifactId> <version>2.4</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>2.4</version> </dependency> <dependency> <groupId>org.testingisdocumenting.webtau</groupId> <artifactId>webtau-junit4</artifactId> <version>2.4</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() { } } junit5/JUnit-4 Learn more about JUnit4 features