Skip to content

WebTau (short for web test automation) is a testing API, command line tool and a framework to write unit, integration and end-to-end tests. Test across REST-API, Graph QL, Browser, Database, CLI and Business Logic with consistent set of matchers and concepts. REPL mode speeds-up tests development. Rich reporting cuts down investigation time.

License

Notifications You must be signed in to change notification settings

AlexRogalskiy/webtau

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build

WebTau

Web Test Automation User Guide

logo

WebTau (Web Test automation) - concise and expressive way to write end-to-end and unit tests.

Test your application across multiple layers:

  • REST API (including Data Coverage)
  • GraphQL API
  • Web UI
  • CLI
  • Database
  • Business Logic (JVM only)

REST test Java example:

public class WeatherJavaTest {
    @Test
    public void checkWeather() {
        http.get("/weather", (header, body) -> {
            body.get("temperature").shouldBe(lessThan(100));
        });
    }
}

server response

{
  "temperature": 88
}

REST test Groovy example:

scenario("check weather") {
    http.get("/weather") {
        temperature.shouldBe < 100
    }
}

Use Persona Concept to streamline Authorization testing

scenario("my bank balance") {
    Alice {
        http.get("/statement") {
            balance.shouldBe > 100
        }
    }

    Bob {
        http.get("/statement") {
            balance.shouldBe < 50
        }
    }
}

Alice server response

{
  "balance": 150
}

Bob server response

{
  "balance": 30
}
public class PersonaHttpJavaTest {
    @Test
    public void checkBalance() {
        Alice.execute(() -> http.get("/statement", (header, body) -> {
            body.get("balance").shouldBe(greaterThan(100));
        }));

        Bob.execute(() -> http.get("/statement", (header, body) -> {
            body.get("balance").shouldBe(lessThan(50));
        }));
    }
}

Use one layer to re-enforce tests on another. E.g. REST API layer to set up data for Web UI test, or database layer to validate GraphQL API.

Use REPL to tighten test feedback loop and speed up test writing

webtau:000> $("ul li a")
element is found: by css ul li a
           getText(): Guide
getUnderlyingValue(): Guide
               count: 3

Capture test artifacts like API Responses, screenshots, command line output to automate your user facing documentation.

Leverage out of the box rich reporting: report example

Tests can be written in any JVM language. Language specific syntactic sugar is available for Groovy.


Browser test Java example:

@WebTau
public class WebSearchTest {
    @Test
    public void searchByQuery() {
        search.submit("search this");
        search.numberOfResults.waitToBe(greaterThan(1));
    }
}

public class SearchPage {
    private final PageElement box = $("#search-box");
    private final PageElement results = $("#results .result");
    public final ElementValue<Integer> numberOfResults = results.getCount();

    public void submit(String query) {
        browser.open("/search");

        box.setValue(query);
        box.sendKeys(browser.keys.enter);
    }
}

GraphQL example:

@WebTau
public class GraphQLWeatherJavaIT {
    @Test
    public void checkWeather() {
        String query = "{ weather { temperature } }";
        graphql.execute(query, (header, body) -> {
            body.get("data.weather.temperature").shouldBe(lessThan(100));
        });
    }
}

Database data setup example:

def PRICES = db.table("PRICES")
PRICES << [     "id" | "description" |          "available" |                "type" |       "price" ] {
           _____________________________________________________________________________________________
           cell.guid | "nice set"    |                 true |                "card" |            1000
           cell.guid | "nice set"    |                 true |                "card" | cell.above   10
           cell.guid | "another set" | permute(true, false) | permute("rts", "fps") | cell.above   20 }

CLI run example:

cli.run('echo hello world') {
    output.should contain('hello')
    output.should contain('world')
}

Learn More

About

WebTau (short for web test automation) is a testing API, command line tool and a framework to write unit, integration and end-to-end tests. Test across REST-API, Graph QL, Browser, Database, CLI and Business Logic with consistent set of matchers and concepts. REPL mode speeds-up tests development. Rich reporting cuts down investigation time.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 51.4%
  • Groovy 34.4%
  • JavaScript 7.2%
  • TypeScript 3.4%
  • CSS 2.1%
  • HTML 1.3%
  • Other 0.2%