Skip to content

Commit 1122321

Browse files
docs: update readme and docs intro (#1447)
1 parent 0806c79 commit 1122321

8 files changed

Lines changed: 30 additions & 175 deletions

File tree

README.md

Lines changed: 18 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -12,180 +12,27 @@ Web Test Automation [User Guide](https://testingisdocumenting.org/webtau/)
1212

1313
WebTau (**Web** **T**est **au**tomation) - concise and expressive way to write end-to-end and unit tests.
1414

15-
Test your application across multiple layers:
16-
* REST API (including [Data Coverage](https://testingisdocumenting.org/webtau/HTTP/data-coverage/))
17-
* GraphQL API
18-
* Web UI
19-
* CLI
20-
* Database
21-
* Business Logic (JVM only)
15+
Test your application across multiple layers and use unique features:
16+
* [REST API with Data Coverage](https://testingisdocumenting.org/webtau/getting-started/what-is-this#rest-api)
17+
* [Web Socket](https://testingisdocumenting.org/webtau/getting-started/what-is-this#websocket)
18+
* [GraphQL API](https://testingisdocumenting.org/webtau/getting-started/what-is-this#graphql-api)
19+
* [Browser](https://testingisdocumenting.org/webtau/getting-started/what-is-this#browser)
20+
* [Fake, Static And Proxy Servers](https://testingisdocumenting.org/webtau/getting-started/what-is-this#fake-static-and-proxy-servers)
21+
* [Database](https://testingisdocumenting.org/webtau/getting-started/what-is-this#database)
22+
* [CLI](https://testingisdocumenting.org/webtau/getting-started/what-is-this#cli)
23+
* [Business Logic (JVM only)](https://testingisdocumenting.org/webtau/getting-started/what-is-this#business-logic-jvm)
24+
* [REPL](https://testingisdocumenting.org/webtau/getting-started/what-is-this#repl)
25+
* [Reporting](https://testingisdocumenting.org/webtau/getting-started/what-is-this#reporting)
26+
* [Documentation Assistance](https://testingisdocumenting.org/webtau/getting-started/what-is-this#documentation-assistance)
2227

23-
## [Business Logic Java Example](https://testingisdocumenting.org/webtau/matchers/java-bean)
28+
There are many modules, but you can use any module you need independently, or use all the modules at once with convenient single imports.
2429

25-
### Single Bean Validation
30+
**Note:** Tests can be written in any JVM language. Language specific syntactic sugar is available for `Groovy`.
2631

27-
```java
28-
actual(account).should(equal(map(
29-
"id", "ac1",
30-
"name", "My Second Account",
31-
"address", map("zipCode", "7777777"))));
32-
```
32+
Unique console output keeps you informed at all times:
3333

34-
![webtau bean validation output](webtau-docs/readme/bean-validation-output.png)
34+
![image of http resource code and its output](webtau-docs/readme/live-price-http.png)
3535

36-
### List Of Beans Validation
37-
38-
```java
39-
List<Account> accounts = fetchAccounts();
40-
TableData expected = table("*id", "name", "address",
41-
________________________________________,
42-
"ac2", "Works", map("zipCode", "zip2"),
43-
"ac1", "Home", map("zipCode", "zip1"),
44-
"ac3", "My Account", map("zipCode", "zip8"));
45-
```
36+
Leverage out of the box rich reporting to speed up investigation and persist testing evidences:
4637

47-
![webtau list of beans validation output](webtau-docs/readme/bean-list-validation.png)
48-
49-
## [REST test Java example](https://testingisdocumenting.org/webtau/HTTP/introduction):
50-
```java
51-
public class WeatherJavaTest {
52-
@Test
53-
public void checkWeather() {
54-
http.get("/weather", (header, body) -> {
55-
body.get("temperature").shouldBe(lessThan(100));
56-
});
57-
}
58-
}
59-
```
60-
61-
WebTau prints a lot of useful information with a zero effort from your side. So you can investigate tests faster.
62-
![webtau http output](webtau-docs/readme/http-weather-test-output.png)
63-
64-
[REST test Groovy example](https://testingisdocumenting.org/webtau/HTTP/introduction):
65-
```groovy
66-
scenario("check weather") {
67-
http.get("/weather") {
68-
temperature.shouldBe < 100
69-
}
70-
}
71-
```
72-
73-
## [Persona Concept](https://testingisdocumenting.org/webtau/persona/introduction)
74-
75-
Use `Persona` to streamline Authorization testing
76-
77-
```java
78-
public class PersonaHttpJavaTest {
79-
@Test
80-
public void checkBalance() {
81-
Alice.execute(() -> http.get("/statement", (header, body) -> {
82-
body.get("balance").shouldBe(greaterThan(100));
83-
}));
84-
85-
Bob.execute(() -> http.get("/statement", (header, body) -> {
86-
body.get("balance").shouldBe(lessThan(50));
87-
}));
88-
}
89-
}
90-
```
91-
92-
![webtau persona output](webtau-docs/readme/http-persona-output.png)
93-
94-
```groovy
95-
scenario("my bank balance") {
96-
Alice {
97-
http.get("/statement") {
98-
balance.shouldBe > 100
99-
}
100-
}
101-
102-
Bob {
103-
http.get("/statement") {
104-
balance.shouldBe < 50
105-
}
106-
}
107-
}
108-
```
109-
110-
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
111-
to validate GraphQL API.
112-
113-
Use REPL to tighten test feedback loop and speed up test writing
114-
```groovy
115-
webtau:000> $("ul li a")
116-
element is found: by css ul li a
117-
getText(): Guide
118-
getUnderlyingValue(): Guide
119-
count: 3
120-
```
121-
122-
Capture test artifacts like API Responses, screenshots, command line output to automate your user facing documentation.
123-
124-
Leverage out of the box rich reporting:
125-
![report example](https://testingisdocumenting.org/webtau/doc-artifacts/reports/report-crud-separated-http-calls.png)
126-
127-
Tests can be written in any JVM language. Language specific syntactic sugar is available for `Groovy`.
128-
129-
* [Full User Guide](https://testingisdocumenting.org/webtau/)
130-
* [Multiple layers testing example blog](https://testingisdocumenting.org/blog/entry/ultimate-end-to-end-test)
131-
132-
--------
133-
134-
## [Browser test Java example](https://testingisdocumenting.org/webtau/browser/introduction):
135-
```java
136-
@WebTau
137-
public class WebSearchTest {
138-
@Test
139-
public void searchByQuery() {
140-
search.submit("search this");
141-
search.numberOfResults.waitToBe(greaterThan(1));
142-
}
143-
}
144-
145-
public class SearchPage {
146-
private final PageElement box = $("#search-box");
147-
private final PageElement results = $("#results .result");
148-
public final ElementValue<Integer> numberOfResults = results.getCount();
149-
150-
public void submit(String query) {
151-
browser.open("/search");
152-
153-
box.setValue(query);
154-
box.sendKeys(browser.keys.enter);
155-
}
156-
}
157-
```
158-
159-
## [GraphQL example](https://testingisdocumenting.org/webtau/GraphQL/introduction):
160-
```java
161-
@WebTau
162-
public class GraphQLWeatherJavaIT {
163-
@Test
164-
public void checkWeather() {
165-
String query = "{ weather { temperature } }";
166-
graphql.execute(query, (header, body) -> {
167-
body.get("data.weather.temperature").shouldBe(lessThan(100));
168-
});
169-
}
170-
}
171-
```
172-
173-
## [Database data setup example](https://testingisdocumenting.org/webtau/database/data-setup):
174-
```groovy
175-
def PRICES = db.table("PRICES")
176-
PRICES << [ "id" | "description" | "available" | "type" | "price" ] {
177-
_____________________________________________________________________________________________
178-
cell.guid | "nice set" | true | "card" | 1000
179-
cell.guid | "nice set" | true | "card" | cell.above + 10
180-
cell.guid | "another set" | permute(true, false) | permute("rts", "fps") | cell.above + 20 }
181-
```
182-
183-
## [CLI run example](https://testingisdocumenting.org/webtau/cli/introduction):
184-
```groovy
185-
cli.run('echo hello world') {
186-
output.should contain('hello')
187-
output.should contain('world')
188-
}
189-
```
190-
191-
[Learn More](https://testingisdocumenting.org/webtau/)
38+
![report example](https://testingisdocumenting.org/webtau/doc-artifacts/reports/report-crud-separated-http-calls.png)
-173 KB
Binary file not shown.
-133 KB
Binary file not shown.
-185 KB
Binary file not shown.
-103 KB
Binary file not shown.
227 KB
Loading

webtau-docs/znai/getting-started/what-is-this.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ WebTau (**Web** **T**est **au**tomation) - concise and expressive way to write e
44

55
:include-image: webtau-logo.png {scale: 0.5, align: "left"}
66

7-
Test your application across multiple layers with the help of cross-cutting concepts:
7+
Test your application across multiple layers and use unique features:
8+
89
* [REST API](#rest-api)
910
* [WebSocket](#websocket)
1011
* [GraphQL API](#graphql-api)
1112
* [Authorization Personas](#persona)
1213
* [Browser](#browser)
14+
* [Fake, Static And Proxy Servers](#fake-static-and-proxy-servers)
1315
* [Database](#database)
1416
* [CLI](#cli)
1517
* [Business Logic (JVM only)](#business-logic-jvm)
@@ -69,6 +71,12 @@ Java:
6971

7072
[Read More](browser/basic-configuration)
7173

74+
# Fake, Static And Proxy Servers
75+
76+
:include-markdown: servers/introduction.md
77+
78+
[Read More](servers/introduction)
79+
7280
# Database
7381

7482
WebTau `db` module streamlines databases data setup, assertion and waiting on.

webtau-docs/znai/servers/introduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
WebTau `server.` module lets you create and control static, fake and proxy servers:
1+
WebTau `server` module lets you create and control static, fake and proxy servers:
2+
23
* Static servers to quickly host HTML, JSON, and similar content
34
* Fake servers to control response based request
45
* Proxy servers to simulate outages and record interactions for failures investigation
@@ -10,8 +11,7 @@ WebTau `server.` module lets you create and control static, fake and proxy serve
1011

1112
:include-file: scenarios/server/fakeRest.groovy {
1213
title: "fake server creation example",
13-
includeRegexp: "router-example",
14-
commentsType: "remove"
14+
surroundedBy: "router-example"
1515
}
1616

1717
:include-file: scenarios/server/proxyServer.groovy {

0 commit comments

Comments
 (0)