|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | +<meta charset="utf-8" /> |
| 5 | +<title>WebTau: Data Driven</title><link rel="stylesheet" type="text/css" href="/webtau/static/css/bootstrap.min.css"> |
| 6 | +<link rel="stylesheet" type="text/css" href="/webtau/static/css/katex.min.css"> |
| 7 | +<link rel="stylesheet" type="text/css" href="/webtau/static/main.css"> |
| 8 | +<link rel="stylesheet" type="text/css" href="/webtau/logo.css"> |
| 9 | +<link rel="stylesheet" type="text/css" href="/webtau/static/css/global-overrides.css"> |
| 10 | +</head> |
| 11 | +<link rel="shortcut icon" href="/webtau/favicon.png"type="image/ico"/> |
| 12 | +<body> |
| 13 | +<div id="znai"><div id="znai-initial-page-loading" style="margin: -20px 0 0 -20px; padding: 0 40px 40px 0; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center"> |
| 14 | + <div></div> |
| 15 | +</div><section style="max-width: 640px; margin-left: auto; margin-right: auto;"> |
| 16 | +<article> |
| 17 | +<header><h1>Data Focused Tests</h1></header> |
| 18 | +<p>Webtau simplifies writing REST and UI tests. But if the logic behind REST and UI is written in JVM based language, webtau can also simplify testing the logic directly.Webtau makes tests to be focused on input and output by reducing boilerplate.</p> |
| 19 | +</article> |
| 20 | + |
| 21 | +<article> |
| 22 | +<header><h1>Simplified Input Preparation</h1></header> |
| 23 | +<p>Groovy Java @Test public void diversifiedTeamsShouldHaveVariousLevelsAndTimeAtCompany() { TableData employeeData = table( "id", "level", "monthsAtCompany").values( "bob", 2, 12, "smith", 4, 34, "john", 3, 20); boolean diversified = peopleManagement.diversityLevel(employees(employeeData)); actual(diversified).should(equal(true)); }</p> |
| 24 | +</article> |
| 25 | + |
| 26 | +<article> |
| 27 | +<header><h1>Simplified Output Validation</h1></header> |
| 28 | +<p>Complex data and assertions are first class citizens. Groovy Java @Test public void providesAccessToNewJoiners() { TableData allEmployees = table( "id", "level", "monthsAtCompany", ____________________________________, "alice", 5, 1, "bob", 3, 0, "smith", 4, 1, "cat", 4, 0); addEmployees(allEmployees); actual(dao.thisWeekJoiners()).should(equal(table( "*id", "level", "monthsAtCompany", ____________________________________, "bob", 3, 0, "cat", 4, 0))); } Note: The examples above assumes import static org.testingisdocumenting.webtau.WebTauCore.* or import static org.testingisdocumenting.webtau.WebTauDsl.* . For more TableData features, check reference/table-data reference page</p> |
| 29 | +</article> |
| 30 | +</section> |
| 31 | +</div> |
| 32 | +<script type="text/javascript" src="/webtau/toc.js"></script> |
| 33 | +<script type="text/javascript" src="/webtau/assets.js"></script> |
| 34 | +<script type="text/javascript" src="/webtau/static/react.min.js"></script> |
| 35 | +<script type="text/javascript" src="/webtau/static/react-dom.min.js"></script> |
| 36 | +<script type="text/javascript" src="/webtau/static/main.js"></script> |
| 37 | +<script type="text/javascript" src="/webtau/search-index.js"></script> |
| 38 | +<script> |
| 39 | +document.getElementById('znai').innerHTML = ''; |
| 40 | +ReactDOM.render(React.createElement(Documentation, { |
| 41 | + "docMeta" : { |
| 42 | + "viewOn" : { |
| 43 | + "link" : "https://github.com/testingisdocumenting/webtau/tree/master/webtau-docs/webtau", |
| 44 | + "title" : "View On GitHub" |
| 45 | + }, |
| 46 | + "id" : "webtau", |
| 47 | + "title" : "WebTau", |
| 48 | + "type" : "Guide", |
| 49 | + "previewEnabled" : false |
| 50 | + }, |
| 51 | + "page" : { |
| 52 | + "type" : "Page", |
| 53 | + "content" : [ { |
| 54 | + "title" : "Data Focused Tests", |
| 55 | + "id" : "data-focused-tests", |
| 56 | + "type" : "Section", |
| 57 | + "content" : [ { |
| 58 | + "type" : "Paragraph", |
| 59 | + "content" : [ { |
| 60 | + "text" : "Webtau simplifies writing REST and UI tests. But if the logic behind REST and UI is written in JVM based language,", |
| 61 | + "type" : "SimpleText" |
| 62 | + }, { |
| 63 | + "type" : "SoftLineBreak" |
| 64 | + }, { |
| 65 | + "text" : "webtau can also simplify testing the logic directly.", |
| 66 | + "type" : "SimpleText" |
| 67 | + } ] |
| 68 | + }, { |
| 69 | + "type" : "Paragraph", |
| 70 | + "content" : [ { |
| 71 | + "text" : "Webtau makes tests to be focused on input and output by reducing boilerplate.", |
| 72 | + "type" : "SimpleText" |
| 73 | + } ] |
| 74 | + } ] |
| 75 | + }, { |
| 76 | + "title" : "Simplified Input Preparation", |
| 77 | + "id" : "simplified-input-preparation", |
| 78 | + "type" : "Section", |
| 79 | + "content" : [ { |
| 80 | + "tabsContent" : [ { |
| 81 | + "name" : "Groovy", |
| 82 | + "content" : [ { |
| 83 | + "lang" : "groovy", |
| 84 | + "snippet" : "@Test\nvoid \"diversified teams should have various levels and time at company\"() {\n def employeeData = [ \"id\" | \"level\" | \"monthsAtCompany\"] {\n _______________________________________\n \"bob\" | 2 | 12\n \"smith\" | 4 | 34\n \"john\" | 3 | 20 }\n\n def diversified = peopleManagement.diversityLevel(employees(employeeData))\n diversified.should == true\n}", |
| 85 | + "entry" : "diversified teams should have various levels and time at company", |
| 86 | + "type" : "Snippet" |
| 87 | + } ] |
| 88 | + }, { |
| 89 | + "name" : "Java", |
| 90 | + "content" : [ { |
| 91 | + "lang" : "java", |
| 92 | + "snippet" : "@Test\npublic void diversifiedTeamsShouldHaveVariousLevelsAndTimeAtCompany() {\n TableData employeeData = table( \"id\", \"level\", \"monthsAtCompany\").values(\n \"bob\", 2, 12,\n \"smith\", 4, 34,\n \"john\", 3, 20);\n\n boolean diversified = peopleManagement.diversityLevel(employees(employeeData));\n actual(diversified).should(equal(true));\n}", |
| 93 | + "entry" : "diversifiedTeamsShouldHaveVariousLevelsAndTimeAtCompany", |
| 94 | + "type" : "Snippet" |
| 95 | + } ] |
| 96 | + } ], |
| 97 | + "type" : "Tabs" |
| 98 | + } ] |
| 99 | + }, { |
| 100 | + "title" : "Simplified Output Validation", |
| 101 | + "id" : "simplified-output-validation", |
| 102 | + "type" : "Section", |
| 103 | + "content" : [ { |
| 104 | + "type" : "Paragraph", |
| 105 | + "content" : [ { |
| 106 | + "text" : "Complex data and assertions are first class citizens.", |
| 107 | + "type" : "SimpleText" |
| 108 | + } ] |
| 109 | + }, { |
| 110 | + "tabsContent" : [ { |
| 111 | + "name" : "Groovy", |
| 112 | + "content" : [ { |
| 113 | + "lang" : "groovy", |
| 114 | + "snippet" : "@Test\nvoid \"provides access to new joiners\"() {\n TableData allEmployees = [\"id\" | \"level\" | \"monthsAtCompany\"] {\n ______________________________________\n \"alice\" | 5 | 1\n \"bob\" | 3 | 0\n \"smith\" | 4 | 1\n \"cat\" | 4 | 0 }\n\n addEmployees(allEmployees)\n\n dao.thisWeekJoiners().should == [\"id\" | \"level\" | \"monthsAtCompany\"] {\n ______________________________________\n \"bob\" | 3 | 0\n \"cat\" | 4 | 0 }\n}", |
| 115 | + "entry" : "provides access to new joiners", |
| 116 | + "type" : "Snippet" |
| 117 | + } ] |
| 118 | + }, { |
| 119 | + "name" : "Java", |
| 120 | + "content" : [ { |
| 121 | + "lang" : "java", |
| 122 | + "snippet" : "@Test\npublic void providesAccessToNewJoiners() {\n TableData allEmployees = table( \"id\", \"level\", \"monthsAtCompany\",\n ____________________________________,\n \"alice\", 5, 1,\n \"bob\", 3, 0,\n \"smith\", 4, 1,\n \"cat\", 4, 0);\n addEmployees(allEmployees);\n\n actual(dao.thisWeekJoiners()).should(equal(table( \"*id\", \"level\", \"monthsAtCompany\",\n ____________________________________,\n \"bob\", 3, 0,\n \"cat\", 4, 0)));\n}", |
| 123 | + "entry" : "providesAccessToNewJoiners", |
| 124 | + "type" : "Snippet" |
| 125 | + }, { |
| 126 | + "type" : "Paragraph", |
| 127 | + "content" : [ { |
| 128 | + "text" : "Note: The examples above assumes ", |
| 129 | + "type" : "SimpleText" |
| 130 | + }, { |
| 131 | + "code" : "import static org.testingisdocumenting.webtau.WebTauCore.*", |
| 132 | + "type" : "InlinedCode" |
| 133 | + }, { |
| 134 | + "text" : " or ", |
| 135 | + "type" : "SimpleText" |
| 136 | + }, { |
| 137 | + "code" : "import static org.testingisdocumenting.webtau.WebTauDsl.*", |
| 138 | + "type" : "InlinedCode" |
| 139 | + }, { |
| 140 | + "text" : ".", |
| 141 | + "type" : "SimpleText" |
| 142 | + } ] |
| 143 | + } ] |
| 144 | + } ], |
| 145 | + "type" : "Tabs" |
| 146 | + }, { |
| 147 | + "type" : "Paragraph", |
| 148 | + "content" : [ { |
| 149 | + "text" : "For more ", |
| 150 | + "type" : "SimpleText" |
| 151 | + }, { |
| 152 | + "code" : "TableData", |
| 153 | + "type" : "InlinedCode" |
| 154 | + }, { |
| 155 | + "text" : " features, check ", |
| 156 | + "type" : "SimpleText" |
| 157 | + }, { |
| 158 | + "url" : "/webtau/reference/table-data", |
| 159 | + "isFile" : false, |
| 160 | + "type" : "Link", |
| 161 | + "content" : [ { |
| 162 | + "text" : "reference page", |
| 163 | + "type" : "SimpleText" |
| 164 | + } ] |
| 165 | + } ] |
| 166 | + } ] |
| 167 | + } ], |
| 168 | + "lastModifiedTime" : 1584487110000, |
| 169 | + "tocItem" : { |
| 170 | + "sectionTitle" : "JVM Business Logic", |
| 171 | + "pageTitle" : "Data Driven", |
| 172 | + "pageMeta" : { }, |
| 173 | + "dirName" : "JVM-business-logic", |
| 174 | + "fileName" : "data-driven", |
| 175 | + "viewOnRelativePath" : null, |
| 176 | + "pageSectionIdTitles" : [ { |
| 177 | + "title" : "Data Focused Tests", |
| 178 | + "id" : "data-focused-tests" |
| 179 | + }, { |
| 180 | + "title" : "Simplified Input Preparation", |
| 181 | + "id" : "simplified-input-preparation" |
| 182 | + }, { |
| 183 | + "title" : "Simplified Output Validation", |
| 184 | + "id" : "simplified-output-validation" |
| 185 | + } ] |
| 186 | + } |
| 187 | + }, |
| 188 | + "footer" : { } |
| 189 | +}), document.getElementById("znai")); |
| 190 | +</script> |
| 191 | + |
| 192 | +</body> |
| 193 | +</html> |
0 commit comments