Skip to content

Commit 9bcbdb3

Browse files
deploy: e66d745
1 parent 0ab1327 commit 9bcbdb3

163 files changed

Lines changed: 7951 additions & 2672 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

GraphQL/customized-graphql-urls/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@
103103
"docMeta" : {
104104
"viewOn" : {
105105
"link" : "https://github.com/testingisdocumenting/webtau/tree/master/webtau-docs/znai",
106-
"title" : "View On GitHub"
106+
"title" : "View Markdown"
107107
},
108108
"id" : "webtau",
109109
"title" : "WebTau",
110110
"type" : "Guide",
111111
"previewEnabled" : false,
112-
"allowedGroups" : [ "admin" ]
112+
"support" : {
113+
"link" : "https://github.com/testingisdocumenting/webtau/discussions"
114+
}
113115
},
114116
"page" : {
115117
"type" : "Page",
@@ -201,7 +203,7 @@
201203
"lang" : "groovy"
202204
} ]
203205
} ],
204-
"lastModifiedTime" : 1653578199518,
206+
"lastModifiedTime" : 1658328071382,
205207
"tocItem" : {
206208
"sectionTitle" : "GraphQL",
207209
"pageTitle" : "Customized Graphql Urls",

GraphQL/introduction/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@
102102
"docMeta" : {
103103
"viewOn" : {
104104
"link" : "https://github.com/testingisdocumenting/webtau/tree/master/webtau-docs/znai",
105-
"title" : "View On GitHub"
105+
"title" : "View Markdown"
106106
},
107107
"id" : "webtau",
108108
"title" : "WebTau",
109109
"type" : "Guide",
110110
"previewEnabled" : false,
111-
"allowedGroups" : [ "admin" ]
111+
"support" : {
112+
"link" : "https://github.com/testingisdocumenting/webtau/discussions"
113+
}
112114
},
113115
"page" : {
114116
"type" : "Page",
@@ -257,7 +259,7 @@
257259
} ]
258260
} ]
259261
} ],
260-
"lastModifiedTime" : 1653578199518,
262+
"lastModifiedTime" : 1658328071382,
261263
"tocItem" : {
262264
"sectionTitle" : "GraphQL",
263265
"pageTitle" : "Introduction",

GraphQL/queries-and-mutations/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@
108108
"docMeta" : {
109109
"viewOn" : {
110110
"link" : "https://github.com/testingisdocumenting/webtau/tree/master/webtau-docs/znai",
111-
"title" : "View On GitHub"
111+
"title" : "View Markdown"
112112
},
113113
"id" : "webtau",
114114
"title" : "WebTau",
115115
"type" : "Guide",
116116
"previewEnabled" : false,
117-
"allowedGroups" : [ "admin" ]
117+
"support" : {
118+
"link" : "https://github.com/testingisdocumenting/webtau/discussions"
119+
}
118120
},
119121
"page" : {
120122
"type" : "Page",
@@ -278,7 +280,7 @@
278280
} ]
279281
} ]
280282
} ],
281-
"lastModifiedTime" : 1653578199518,
283+
"lastModifiedTime" : 1658328071382,
282284
"tocItem" : {
283285
"sectionTitle" : "GraphQL",
284286
"pageTitle" : "Queries And Mutations",

GraphQL/report/index.html

Lines changed: 19 additions & 6 deletions
Large diffs are not rendered by default.

HTTP/CRUD-separated/index.html

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
<div></div>
8585
</div><section style="max-width: 640px; margin-left: auto; margin-right: auto;">
8686
<article>
87-
<header><h1>Lazy Resource</h1></header>
88-
<p>Groovy One of the benefits of separating one CRUD scenario into multiple is to be able to run one test at a time. In order to make each test runnable independently we will use createLazyResource . package scenarios.rest.springboot import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* def customerPayload = [firstName: &quot;FN&quot;, lastName: &quot;LN&quot;] def customer = createLazyResource(&quot;customer&quot;) { // lazy resource to be created on the first access def id = http.post(&quot;/customers&quot;, customerPayload) { return id } return new Customer(id: id, url: &quot;/customers/${id}&quot;) // definition is below } scenario(&quot;customer create&quot;) { customer.id.should != null // accessing resource for the first time will trigger POST (in this example) } scenario(&quot;customer read&quot;) { http.get(customer.url) { // convenient re-use of url defined above body.should == customerPayload } } scenario(&quot;customer update&quot;) { def changedLastName = &quot;NLN&quot; http.put(customer.url, [*:customerPayload, lastName: changedLastName]) { lastName.should == changedLastName } http.get(customer.url) { lastName.should == changedLastName } } scenario(&quot;customer delete&quot;) { http.delete(customer.url) { statusCode.should == 204 } http.get(customer.url) { statusCode.should == 404 } } package scenarios.rest.springboot class Customer { Number id String url // store url of the created entity } Note: to run one scenario at a time use sscenario (additional s in front). groovy-standalone-runner/selective-run Read more Java One of the benefits of separating one CRUD @Test into multiple is to be able to run one test at a time. In order to make each test runnable independently we will leverage BeforeAll , AfterAll , and TestMethodOrder . package com.example.tests.junit5; import org.testingisdocumenting.webtau.junit5.WebTau; import org.junit.jupiter.api.*; import java.util.Map; import static org.testingisdocumenting.webtau.WebTauDsl.*; @WebTau @TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order @DisplayName(&quot;customer CRUD&quot;) public class CustomerCrudSeparatedJavaTest { private static final Map&lt;String, ?&gt; customerPayload = aMapOf( &quot;firstName&quot;, &quot;FN&quot;, &quot;lastName&quot;, &quot;LN&quot; ); private static final Map&lt;String, ?&gt; changedCustomerPayload = aMapOf( customerPayload, &quot;lastName&quot;, &quot;NLN&quot;); private static int id; @BeforeAll @DisplayName(&quot;create customer&quot;) // optional friendly name for reporting purposes static void createCustomer() { id = http.post(&quot;/customers&quot;, customerPayload, ((header, body) -&gt; { return body.get(&quot;id&quot;); })); actual(id).shouldNot(equal(0)); } @Test @Order(1) @DisplayName(&quot;read customer&quot;) void read() { http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(customerPayload)); })); } @Test @Order(2) // order dependence saves from creating customer on every test @DisplayName(&quot;update customer&quot;) void update() { http.put(&quot;/customers/&quot; + id, changedCustomerPayload, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); } @Test @Order(3) // but you can still run each method independently @DisplayName(&quot;delete customer&quot;) void delete() { http.delete(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode().should(equal(204)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode().should(equal(404)); })); id = -1; // marking as deleted to let cleanup step know that no delete is required } @AfterAll static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean if (id == -1) { return; } http.delete(&quot;/customers/&quot; + id); } }</p>
87+
<header><h1>HTTP Calls Separation</h1></header>
88+
<p>Groovy One of the benefits of separating one CRUD scenario into multiple is to be able to run one test at a time. In order to make each test runnable independently we will use createLazyResource . package scenarios.rest.springboot import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* def customerPayload = [firstName: &quot;FN&quot;, lastName: &quot;LN&quot;] def customer = createLazyResource(&quot;customer&quot;) { // lazy resource to be created on the first access def id = http.post(&quot;/customers&quot;, customerPayload) { return id } return new Customer(id: id, url: &quot;/customers/${id}&quot;) // definition is below } scenario(&quot;customer create&quot;) { customer.id.should != null // accessing resource for the first time will trigger POST (in this example) } scenario(&quot;customer read&quot;) { http.get(customer.url) { // convenient re-use of url defined above body.should == customerPayload } } scenario(&quot;customer update&quot;) { def changedLastName = &quot;NLN&quot; http.put(customer.url, [*:customerPayload, lastName: changedLastName]) { lastName.should == changedLastName } http.get(customer.url) { lastName.should == changedLastName } } scenario(&quot;customer delete&quot;) { http.delete(customer.url) { statusCode.should == 204 } http.get(customer.url) { statusCode.should == 404 } } package scenarios.rest.springboot class Customer { Number id String url // store url of the created entity } Note: to run one scenario at a time use sscenario (additional s in front). groovy-standalone-runner/selective-run Read more Java One of the benefits of separating one CRUD @Test into multiple is to be able to run one test at a time. In order to make each test runnable independently we will leverage BeforeAll , AfterAll , and TestMethodOrder . package com.example.tests.junit5; import org.testingisdocumenting.webtau.http.request.HttpRequestBody; import org.testingisdocumenting.webtau.junit5.WebTau; import org.junit.jupiter.api.*; import static org.testingisdocumenting.webtau.WebTauDsl.*; @WebTau @TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order @DisplayName(&quot;customer CRUD&quot;) public class CustomerCrudSeparatedJavaTest { private static final HttpRequestBody customerPayload = http.json( &quot;firstName&quot;, &quot;FN&quot;, &quot;lastName&quot;, &quot;LN&quot;); private static final HttpRequestBody changedCustomerPayload = http.json( &quot;firstName&quot;, &quot;FN&quot;, &quot;lastName&quot;, &quot;NLN&quot;); private static int id; @BeforeAll @DisplayName(&quot;create customer&quot;) // optional friendly name for reporting purposes public static void createCustomer() { id = http.post(&quot;/customers&quot;, customerPayload, ((header, body) -&gt; { return body.get(&quot;id&quot;); })); actual(id).shouldNot(equal(0)); } @Test @Order(1) @DisplayName(&quot;read customer&quot;) public void read() { http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(customerPayload)); })); } @Test @Order(2) // order dependence saves from creating customer on every test @DisplayName(&quot;update customer&quot;) public void update() { http.put(&quot;/customers/&quot; + id, changedCustomerPayload, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { body.should(equal(changedCustomerPayload)); })); } @Test @Order(3) // but you can still run each method independently @DisplayName(&quot;delete customer&quot;) public void delete() { http.delete(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode.should(equal(204)); })); http.get(&quot;/customers/&quot; + id, ((header, body) -&gt; { header.statusCode.should(equal(404)); })); id = -1; // marking as deleted to let cleanup step know that no delete is required } @AfterAll public static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean if (id == -1) { return; } http.delete(&quot;/customers/&quot; + id); } }</p>
8989
</article>
9090

9191
<article>
@@ -108,20 +108,22 @@
108108
"docMeta" : {
109109
"viewOn" : {
110110
"link" : "https://github.com/testingisdocumenting/webtau/tree/master/webtau-docs/znai",
111-
"title" : "View On GitHub"
111+
"title" : "View Markdown"
112112
},
113113
"id" : "webtau",
114114
"title" : "WebTau",
115115
"type" : "Guide",
116116
"previewEnabled" : false,
117-
"allowedGroups" : [ "admin" ]
117+
"support" : {
118+
"link" : "https://github.com/testingisdocumenting/webtau/discussions"
119+
}
118120
},
119121
"page" : {
120122
"type" : "Page",
121123
"content" : [ {
122-
"id" : "lazy-resource",
124+
"id" : "http-calls-separation",
123125
"type" : "Section",
124-
"title" : "Lazy Resource",
126+
"title" : "HTTP Calls Separation",
125127
"content" : [ {
126128
"tabsContent" : [ {
127129
"name" : "Groovy",
@@ -225,7 +227,7 @@
225227
"type" : "SimpleText"
226228
} ]
227229
}, {
228-
"snippet" : "package com.example.tests.junit5;\n\nimport org.testingisdocumenting.webtau.junit5.WebTau;\nimport org.junit.jupiter.api.*;\n\nimport java.util.Map;\n\nimport static org.testingisdocumenting.webtau.WebTauDsl.*;\n\n@WebTau\n@TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order\n@DisplayName(\"customer CRUD\")\npublic class CustomerCrudSeparatedJavaTest {\n private static final Map<String, ?> customerPayload = aMapOf(\n \"firstName\", \"FN\",\n \"lastName\", \"LN\" );\n\n private static final Map<String, ?> changedCustomerPayload = aMapOf(\n customerPayload,\n \"lastName\", \"NLN\");\n\n private static int id;\n\n @BeforeAll\n @DisplayName(\"create customer\") // optional friendly name for reporting purposes\n static void createCustomer() {\n id = http.post(\"/customers\", customerPayload, ((header, body) -> {\n return body.get(\"id\");\n }));\n\n actual(id).shouldNot(equal(0));\n }\n\n @Test\n @Order(1)\n @DisplayName(\"read customer\")\n void read() {\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(customerPayload));\n }));\n }\n\n @Test\n @Order(2) // order dependence saves from creating customer on every test\n @DisplayName(\"update customer\")\n void update() {\n http.put(\"/customers/\" + id, changedCustomerPayload, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n }\n\n @Test\n @Order(3) // but you can still run each method independently\n @DisplayName(\"delete customer\")\n void delete() {\n http.delete(\"/customers/\" + id, ((header, body) -> {\n header.statusCode().should(equal(204));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n header.statusCode().should(equal(404));\n }));\n\n id = -1; // marking as deleted to let cleanup step know that no delete is required\n }\n\n @AfterAll\n static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean\n if (id == -1) {\n return;\n }\n\n http.delete(\"/customers/\" + id);\n }\n}",
230+
"snippet" : "package com.example.tests.junit5;\n\nimport org.testingisdocumenting.webtau.http.request.HttpRequestBody;\nimport org.testingisdocumenting.webtau.junit5.WebTau;\nimport org.junit.jupiter.api.*;\n\nimport static org.testingisdocumenting.webtau.WebTauDsl.*;\n\n@WebTau\n@TestMethodOrder(MethodOrderer.OrderAnnotation.class) // forcing methods execution order\n@DisplayName(\"customer CRUD\")\npublic class CustomerCrudSeparatedJavaTest {\n private static final HttpRequestBody customerPayload = http.json(\n \"firstName\", \"FN\",\n \"lastName\", \"LN\");\n\n private static final HttpRequestBody changedCustomerPayload = http.json(\n \"firstName\", \"FN\",\n \"lastName\", \"NLN\");\n\n private static int id;\n\n @BeforeAll\n @DisplayName(\"create customer\") // optional friendly name for reporting purposes\n public static void createCustomer() {\n id = http.post(\"/customers\", customerPayload, ((header, body) -> {\n return body.get(\"id\");\n }));\n\n actual(id).shouldNot(equal(0));\n }\n\n @Test\n @Order(1)\n @DisplayName(\"read customer\")\n public void read() {\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(customerPayload));\n }));\n }\n\n @Test\n @Order(2) // order dependence saves from creating customer on every test\n @DisplayName(\"update customer\")\n public void update() {\n http.put(\"/customers/\" + id, changedCustomerPayload, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n body.should(equal(changedCustomerPayload));\n }));\n }\n\n @Test\n @Order(3) // but you can still run each method independently\n @DisplayName(\"delete customer\")\n public void delete() {\n http.delete(\"/customers/\" + id, ((header, body) -> {\n header.statusCode.should(equal(204));\n }));\n\n http.get(\"/customers/\" + id, ((header, body) -> {\n header.statusCode.should(equal(404));\n }));\n\n id = -1; // marking as deleted to let cleanup step know that no delete is required\n }\n\n @AfterAll\n public static void cleanup() { // optional (since we create new ids all the time) step to keep your environment clean\n if (id == -1) {\n return;\n }\n\n http.delete(\"/customers/\" + id);\n }\n}",
229231
"commentsType" : "inline",
230232
"type" : "Snippet",
231233
"lang" : "java"
@@ -281,14 +283,14 @@
281283
}, {
282284
"fit" : true,
283285
"shapes" : [ ],
284-
"width" : 1200.0,
286+
"width" : 1310.0,
285287
"imageSrc" : "/webtau/doc-artifacts/reports/report-crud-separated-http-calls.png",
286288
"type" : "AnnotatedImage",
287289
"height" : 802.0,
288-
"timestamp" : 1653578886932
290+
"timestamp" : 1658328867830
289291
} ]
290292
} ],
291-
"lastModifiedTime" : 1653578199518,
293+
"lastModifiedTime" : 1658328071382,
292294
"tocItem" : {
293295
"sectionTitle" : "HTTP",
294296
"pageTitle" : "CRUD Separated",
@@ -297,8 +299,8 @@
297299
"fileName" : "CRUD-separated",
298300
"viewOnRelativePath" : null,
299301
"pageSectionIdTitles" : [ {
300-
"title" : "Lazy Resource",
301-
"id" : "lazy-resource"
302+
"title" : "HTTP Calls Separation",
303+
"id" : "http-calls-separation"
302304
}, {
303305
"title" : "Report",
304306
"id" : "report"

0 commit comments

Comments
 (0)