1- WebTau provides two methods to assert values: ` should ` and ` waitTo ` . They work for business logic testing, HTTP, Browser, and other layers.
1+ WebTau 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- WebTau provides console output of all the matches it does, regardless of whether it fails or passes.
4+ WebTau provides console output for all the matching it does, regardless of whether it fails or passes.
55
66# Should
77
@@ -15,7 +15,6 @@ Groovy:
1515 surroundedBy: "string-string-example",
1616 commentsType: "remove"
1717}
18-
1918 Note: Groovy has a shortcut for `equal` matcher.
2019
2120:include-markdown: import-ref.md
8584}
8685```
8786
87+ # Negative Matching
88+
89+ Both ` should ` and ` waitTo ` have negative forms:
90+
91+ ``` tabs
92+ Groovy:
93+ :include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
94+ title: "shouldNot example",
95+ surroundedBy: "string-string-negative-example",
96+ noGap: true
97+ }
98+ :include-cli-output: doc-artifacts/string-string-negative-comparison.txt
99+
100+ Java:
101+ :include-file: org/testingisdocumenting/webtau/MatchersTest.java {
102+ title: "shouldNot example",
103+ surroundedBy: "string-string-negative-example",
104+ noGap: true
105+ }
106+ :include-cli-output: doc-artifacts/string-string-negative-comparison.txt
107+ ```
108+
109+ ``` tabs
110+ Groovy:
111+ :include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
112+ title: "waitToNot example",
113+ surroundedBy: "wait-negative-consume-message",
114+ noGap: true
115+ }
116+ :include-cli-output: doc-artifacts/wait-negative-message.txt
117+
118+ Java:
119+ :include-file: org/testingisdocumenting/webtau/MatchersTest.java {
120+ title: "waitToNot example",
121+ surroundedBy: "wait-negative-consume-message",
122+ noGap: true
123+ }
124+ :include-cli-output: doc-artifacts/wait-negative-message.txt
125+ ```
126+
88127# Failure Output
89128
90129Above you saw how WebTau outputs matched information.
@@ -95,16 +134,16 @@ In case of failed assertion WebTau outputs additional information about the actu
95134Groovy:
96135:include-file: org/testingisdocumenting/webtau/MatchersGroovyTest.groovy {
97136 title: "assertion",
98- surroundedBy: "failed-list"
137+ surroundedBy: "failed-list",
138+ noGap: true
99139}
140+ :include-cli-output: doc-artifacts/list-failure.txt
100141
101142Java:
102143:include-file: org/testingisdocumenting/webtau/MatchersTest.java {
103144 title: "assertion",
104- surroundedBy: "failed-list"
145+ surroundedBy: "failed-list",
146+ noGap: true
105147}
148+ :include-cli-output: doc-artifacts/list-failure.txt
106149```
107-
108- :include-cli-output: doc-artifacts/list-failure.txt {title: "failed assertion console output"}
109-
110- :include-markdown: static-import.md
0 commit comments