11WebTau provides two ways to assert values: ` should ` and ` waitTo ` . They work for business logic testing, HTTP, Browser, and other layers.
22Methods accept a matcher as a second parameter:
33
4+ ``` attention-note
45WebTau provides console output for all the matching it does, regardless of whether it fails or passes.
6+ ```
57
68# Should
79
@@ -13,8 +15,12 @@ Groovy:
1315:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
1416 title: "should example",
1517 surroundedBy: "string-string-example",
16- commentsType: "remove"
18+ commentsType: "remove",
19+ noGap: true,
20+ noGapSeparator: true
1721}
22+ :include-cli-output: doc-artifacts/string-string-comparison-output.txt
23+
1824 Note: Groovy has a shortcut for `equal` matcher.
1925
2026:include-markdown: import-ref.md
@@ -23,12 +29,15 @@ Java:
2329:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
2430 title: "should example",
2531 surroundedBy: "string-string-example",
26- commentsType: "remove"
32+ commentsType: "remove",
33+ noGap: true,
34+ noGapSeparator: true
2735}
36+ :include-cli-output: doc-artifacts/string-string-comparison-output.txt
37+
2838:include-markdown: import-ref.md
2939```
3040
31- :include-cli-output: doc-artifacts/string-string-comparison.txt {title: "should console output"}
3241
3342Use ` shouldBe ` alias to make a better flow with matchers like ` greaterThan ` :
3443
@@ -37,15 +46,21 @@ Groovy:
3746:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
3847 title: "shouldBe example",
3948 surroundedBy: "string-number-example",
40- commentsType: "remove"
49+ commentsType: "remove",
50+ noGap: true,
51+ noGapSeparator: true
4152}
53+ :include-cli-output: doc-artifacts/string-number-comparison-output.txt
4254
4355Java:
4456:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
4557 title: "shouldBe example",
4658 surroundedBy: "string-number-example",
47- commentsType: "remove"
59+ commentsType: "remove",
60+ noGap: true,
61+ noGapSeparator: true
4862}
63+ :include-cli-output: doc-artifacts/string-number-comparison-output.txt
4964```
5065
5166# WaitTo
@@ -56,32 +71,43 @@ Use `waitTo` to wait for a value to eventually match a matcher.
5671Groovy:
5772:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
5873 title: "waitTo example",
59- surroundedBy: "wait-consume-message"
74+ surroundedBy: "wait-consume-message",
75+ noGap: true,
76+ noGapSeparator: true
6077}
78+ :include-cli-output: doc-artifacts/wait-message-output.txt
6179
6280Java:
6381:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
6482 title: "waitTo example",
65- surroundedBy: "wait-consume-message"
83+ surroundedBy: "wait-consume-message",
84+ noGap: true,
85+ noGapSeparator: true
6686}
87+ :include-cli-output: doc-artifacts/wait-message-output.txt
6788```
6889
69- :include-cli-output: doc-artifacts/wait-message.txt {title: "wait console output"}
7090
7191Use ` waitToBe ` alias to make a better flow with matchers like ` greaterThan ` :
7292
7393``` tabs
7494Groovy:
7595:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
7696 title: "waitToBe example",
77- surroundedBy: "wait-number-records"
97+ surroundedBy: "wait-number-records",
98+ noGap: true,
99+ noGapSeparator: true
78100}
101+ :include-cli-output: doc-artifacts/wait-tobe-output.txt
79102
80103Java:
81104:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
82105 title: "waitToBe example",
83- surroundedBy: "wait-number-records"
106+ surroundedBy: "wait-number-records",
107+ noGap: true,
108+ noGapSeparator: true
84109}
110+ :include-cli-output: doc-artifacts/wait-tobe-output.txt
85111```
86112
87113# Negative Matching
@@ -93,35 +119,39 @@ Groovy:
93119:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
94120 title: "shouldNot example",
95121 surroundedBy: "string-string-negative-example",
96- noGap: true
122+ noGap: true,
123+ noGapSeparator: true
97124}
98- :include-cli-output: doc-artifacts/string-string-negative-comparison.txt
125+ :include-cli-output: doc-artifacts/string-string-negative-comparison-output .txt
99126
100127Java:
101128:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
102129 title: "shouldNot example",
103130 surroundedBy: "string-string-negative-example",
104- noGap: true
131+ noGap: true,
132+ noGapSeparator: true
105133}
106- :include-cli-output: doc-artifacts/string-string-negative-comparison.txt
134+ :include-cli-output: doc-artifacts/string-string-negative-comparison-output .txt
107135```
108136
109137``` tabs
110138Groovy:
111139:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
112140 title: "waitToNot example",
113141 surroundedBy: "wait-negative-consume-message",
114- noGap: true
142+ noGap: true,
143+ noGapSeparator: true
115144}
116- :include-cli-output: doc-artifacts/wait-negative-message.txt
145+ :include-cli-output: doc-artifacts/wait-negative-message-output .txt
117146
118147Java:
119148:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
120149 title: "waitToNot example",
121150 surroundedBy: "wait-negative-consume-message",
122- noGap: true
151+ noGap: true,
152+ noGapSeparator: true
123153}
124- :include-cli-output: doc-artifacts/wait-negative-message.txt
154+ :include-cli-output: doc-artifacts/wait-negative-message-output .txt
125155```
126156
127157# Failure Output
@@ -135,15 +165,17 @@ Groovy:
135165:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
136166 title: "assertion",
137167 surroundedBy: "failed-list",
138- noGap: true
168+ noGap: true,
169+ noGapSeparator: true
139170}
140171:include-cli-output: doc-artifacts/list-failure.txt
141172
142173Java:
143174:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
144175 title: "assertion",
145176 surroundedBy: "failed-list",
146- noGap: true
177+ noGap: true,
178+ noGapSeparator: true
147179}
148180:include-cli-output: doc-artifacts/list-failure.txt
149181```
0 commit comments