Giter Club home page Giter Club logo

vmpn / webtau Goto Github PK

View Code? Open in Web Editor NEW

This project forked from testingisdocumenting/webtau

1.0 0.0 0.0 37.43 MB

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, GraphQL, 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.

Home Page: https://testingisdocumenting.org/webtau/

License: Apache License 2.0

Shell 0.05% JavaScript 6.46% Java 53.44% Groovy 33.20% Kotlin 0.05% TypeScript 3.68% CSS 2.02% HTML 1.10% Batchfile 0.01%

webtau's Introduction

build

Discord Server

Join Testing Is Documenting Discord Server to ask questions and discuss features/bugs

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)

Single Bean Validation

actual(account).should(equal(map(
        "id", "ac1",
        "name", "My Second Account",
        "address", map("zipCode", "7777777"))));

webtau bean validation output

List Of Beans Validation

List<Account> accounts = fetchAccounts();
TableData expected = table("*id",       "name", "address",
                           ________________________________________,
                           "ac2",      "Works", map("zipCode", "zip2"),
                           "ac1",       "Home", map("zipCode", "zip1"),
                           "ac3", "My Account", map("zipCode", "zip8"));

webtau list of beans validation output

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

WebTau prints a lot of useful information with a zero effort from your side. So you can investigate tests faster. webtau http output

REST test Groovy example:

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

Use Persona to streamline Authorization testing

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));
        }));
    }
}

webtau persona output

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

    Bob {
        http.get("/statement") {
            balance.shouldBe < 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.


@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);
    }
}
@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));
        });
    }
}
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('echo hello world') {
    output.should contain('hello')
    output.should contain('world')
}

Learn More

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.