|
2 | 2 | <html> |
3 | 3 | <head> |
4 | 4 | <meta charset="utf-8" /> |
5 | | -<title>WebTau: PDF</title><link rel="stylesheet" type="text/css" href="/webtau/guide/static/css/bootstrap.min.css"> |
6 | | -<link rel="stylesheet" type="text/css" href="/webtau/guide/static/css/katex.min.css"> |
7 | | -<link rel="stylesheet" type="text/css" href="/webtau/guide/static/main.css"> |
8 | | -<link rel="stylesheet" type="text/css" href="/webtau/guide/logo.css"> |
| 5 | +<title>WebTau: PDF</title><link rel="stylesheet" type="text/css" href="/guide/static/css/bootstrap.min.css"> |
| 6 | +<link rel="stylesheet" type="text/css" href="/guide/static/css/katex.min.css"> |
| 7 | +<link rel="stylesheet" type="text/css" href="/guide/static/main.css"> |
| 8 | +<link rel="stylesheet" type="text/css" href="/guide/logo.css"> |
9 | 9 | </head> |
10 | | -<link rel="shortcut icon" href="/webtau/guide/favicon.png"type="image/ico"/> |
| 10 | +<link rel="shortcut icon" href="/guide/favicon.png"type="image/ico"/> |
11 | 11 | <body> |
12 | | -<div id="mdoc"><div id="mdoc-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"> |
| 12 | +<div id="mdoc"><!-- |
| 13 | + ~ Copyright 2019 TWO SIGMA OPEN SOURCE, LLC |
| 14 | + ~ |
| 15 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 16 | + ~ you may not use this file except in compliance with the License. |
| 17 | + ~ You may obtain a copy of the License at |
| 18 | + ~ |
| 19 | + ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 20 | + ~ |
| 21 | + ~ Unless required by applicable law or agreed to in writing, software |
| 22 | + ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 23 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 24 | + ~ See the License for the specific language governing permissions and |
| 25 | + ~ limitations under the License. |
| 26 | + --> |
| 27 | + |
| 28 | +<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"> |
13 | 29 | <div></div> |
14 | 30 | </div><section style="max-width: 640px; margin-left: auto; margin-right: auto;"> |
15 | 31 | <article> |
|
18 | 34 | </article> |
19 | 35 | </section> |
20 | 36 | </div> |
21 | | -<script type="text/javascript" src="/webtau/guide/toc.js"></script> |
22 | | -<script type="text/javascript" src="/webtau/guide/static/react.min.js"></script> |
23 | | -<script type="text/javascript" src="/webtau/guide/static/react-dom.min.js"></script> |
24 | | -<script type="text/javascript" src="/webtau/guide/static/main.js"></script> |
25 | | -<script type="text/javascript" src="/webtau/guide/search-index.js"></script> |
| 37 | +<script type="text/javascript" src="/guide/toc.js"></script> |
| 38 | +<script type="text/javascript" src="/guide/assets.js"></script> |
| 39 | +<script type="text/javascript" src="/guide/static/react.min.js"></script> |
| 40 | +<script type="text/javascript" src="/guide/static/react-dom.min.js"></script> |
| 41 | +<script type="text/javascript" src="/guide/static/main.js"></script> |
| 42 | +<script type="text/javascript" src="/guide/search-index.js"></script> |
26 | 43 | <script> |
27 | 44 | document.getElementById('mdoc').innerHTML = ''; |
28 | 45 | ReactDOM.render(React.createElement(Documentation, { |
29 | | - "docMeta": { |
30 | | - "viewOn": { |
31 | | - "link": "https://github.com/twosigma/webtau/tree/master/webtau-docs/webtau", |
32 | | - "title": "View On GitHub" |
| 46 | + "docMeta" : { |
| 47 | + "viewOn" : { |
| 48 | + "link" : "https://github.com/twosigma/webtau/tree/master/webtau-docs/webtau", |
| 49 | + "title" : "View On GitHub" |
33 | 50 | }, |
34 | | - "id": "webtau/guide", |
35 | | - "title": "WebTau", |
36 | | - "type": "Guide", |
37 | | - "previewEnabled": false |
| 51 | + "id" : "guide", |
| 52 | + "title" : "WebTau", |
| 53 | + "type" : "Guide", |
| 54 | + "previewEnabled" : false |
38 | 55 | }, |
39 | | - "page": { |
40 | | - "type": "Page", |
41 | | - "content": [ |
42 | | - { |
43 | | - "title": "Asserting Text", |
44 | | - "id": "asserting-text", |
45 | | - "type": "Section", |
46 | | - "content": [ |
47 | | - { |
48 | | - "type": "Paragraph", |
49 | | - "content": [ |
50 | | - { |
51 | | - "text": "If response contains a pdf file you can assert its content using ", |
52 | | - "type": "SimpleText" |
53 | | - }, |
54 | | - { |
55 | | - "code": "pdf(body)", |
56 | | - "type": "InlinedCode" |
57 | | - }, |
58 | | - { |
59 | | - "text": " function.", |
60 | | - "type": "SimpleText" |
61 | | - } |
62 | | - ] |
63 | | - }, |
64 | | - { |
65 | | - "lang": "groovy", |
66 | | - "snippet": "http.get(\"/report\") {\n pdf(body).pageText(0).should contain(\u0027Quarterly earnings:\u0027)\n}", |
67 | | - "entry": "download pdf and assert page text using contains", |
68 | | - "bodyOnly": true, |
69 | | - "type": "Snippet" |
70 | | - }, |
71 | | - { |
72 | | - "type": "Paragraph", |
73 | | - "content": [ |
74 | | - { |
75 | | - "text": "If more than one assertion needs to be made, assign ", |
76 | | - "type": "SimpleText" |
77 | | - }, |
78 | | - { |
79 | | - "code": "pdf", |
80 | | - "type": "InlinedCode" |
81 | | - }, |
82 | | - { |
83 | | - "text": " result to a local variable.", |
84 | | - "type": "SimpleText" |
85 | | - } |
86 | | - ] |
87 | | - }, |
88 | | - { |
89 | | - "lang": "groovy", |
90 | | - "snippet": "http.get(\"/report\") {\n def pdf \u003d pdf(body)\n pdf.pageText(0).should contain(\u0027Quarterly earnings:\u0027)\n pdf.pageText(1).should \u003d\u003d \u0027Intentional blank page\\n\u0027\n}", |
91 | | - "entry": "download pdf and assert page text using equal and contains", |
92 | | - "bodyOnly": true, |
93 | | - "type": "Snippet" |
94 | | - }, |
95 | | - { |
96 | | - "type": "Paragraph", |
97 | | - "content": [ |
98 | | - { |
99 | | - "text": "Note: use pdf assertions for sanity checks like presence of correct client names or account numbers. Leave comprehensive pdf generation test to unit tests.", |
100 | | - "type": "SimpleText" |
101 | | - } |
102 | | - ] |
103 | | - } |
104 | | - ] |
105 | | - } |
106 | | - ], |
107 | | - "lastModifiedTime": 1555462050000, |
108 | | - "tocItem": { |
109 | | - "sectionTitle": "REST", |
110 | | - "pageTitle": "PDF", |
111 | | - "pageMeta": {}, |
112 | | - "fileName": "PDF", |
113 | | - "dirName": "REST", |
114 | | - "pageSectionIdTitles": [ |
115 | | - { |
116 | | - "title": "Asserting Text", |
117 | | - "id": "asserting-text" |
118 | | - } |
119 | | - ] |
| 56 | + "page" : { |
| 57 | + "type" : "Page", |
| 58 | + "content" : [ { |
| 59 | + "title" : "Asserting Text", |
| 60 | + "id" : "asserting-text", |
| 61 | + "type" : "Section", |
| 62 | + "content" : [ { |
| 63 | + "type" : "Paragraph", |
| 64 | + "content" : [ { |
| 65 | + "text" : "If response contains a pdf file you can assert its content using ", |
| 66 | + "type" : "SimpleText" |
| 67 | + }, { |
| 68 | + "code" : "pdf(body)", |
| 69 | + "type" : "InlinedCode" |
| 70 | + }, { |
| 71 | + "text" : " function.", |
| 72 | + "type" : "SimpleText" |
| 73 | + } ] |
| 74 | + }, { |
| 75 | + "lang" : "groovy", |
| 76 | + "snippet" : "http.get(\"/report\") {\n pdf(body).pageText(0).should contain('Quarterly earnings:')\n}", |
| 77 | + "entry" : "download pdf and assert page text using contains", |
| 78 | + "bodyOnly" : true, |
| 79 | + "type" : "Snippet" |
| 80 | + }, { |
| 81 | + "type" : "Paragraph", |
| 82 | + "content" : [ { |
| 83 | + "text" : "If more than one assertion needs to be made, assign ", |
| 84 | + "type" : "SimpleText" |
| 85 | + }, { |
| 86 | + "code" : "pdf", |
| 87 | + "type" : "InlinedCode" |
| 88 | + }, { |
| 89 | + "text" : " result to a local variable.", |
| 90 | + "type" : "SimpleText" |
| 91 | + } ] |
| 92 | + }, { |
| 93 | + "lang" : "groovy", |
| 94 | + "snippet" : "http.get(\"/report\") {\n def pdf = pdf(body)\n pdf.pageText(0).should contain('Quarterly earnings:')\n pdf.pageText(1).should == 'Intentional blank page\\n'\n}", |
| 95 | + "entry" : "download pdf and assert page text using equal and contains", |
| 96 | + "bodyOnly" : true, |
| 97 | + "type" : "Snippet" |
| 98 | + }, { |
| 99 | + "type" : "Paragraph", |
| 100 | + "content" : [ { |
| 101 | + "text" : "Note: use pdf assertions for sanity checks like presence of correct client names or account numbers. Leave comprehensive pdf generation test to unit tests.", |
| 102 | + "type" : "SimpleText" |
| 103 | + } ] |
| 104 | + } ] |
| 105 | + } ], |
| 106 | + "lastModifiedTime" : 1531229167000, |
| 107 | + "tocItem" : { |
| 108 | + "sectionTitle" : "REST", |
| 109 | + "pageTitle" : "PDF", |
| 110 | + "pageMeta" : { }, |
| 111 | + "fileName" : "PDF", |
| 112 | + "dirName" : "REST", |
| 113 | + "pageSectionIdTitles" : [ { |
| 114 | + "title" : "Asserting Text", |
| 115 | + "id" : "asserting-text" |
| 116 | + } ] |
120 | 117 | } |
121 | 118 | }, |
122 | | - "footer": {} |
| 119 | + "footer" : { } |
123 | 120 | }), document.getElementById("mdoc")); |
124 | 121 | </script> |
125 | 122 |
|
|
0 commit comments