|
20 | 20 | {{#if headerParameters}} |
21 | 21 | .set({ |
22 | 22 | {{#each headerParameters}} |
23 | | - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} |
| 23 | + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} |
24 | 24 | {{/each}} |
25 | 25 | }) |
26 | 26 | {{/if}} |
|
61 | 61 | if (err) return done(err); |
62 | 62 |
|
63 | 63 | {{#validateResponse returnType noSchema}} |
64 | | - {{#isJsonMediaType returnType}} |
65 | 64 | {{#is assertion 'expect'}} |
66 | 65 | expect(validator.validate(res.body, schema)).to.be.true; |
67 | 66 | {{/is}} |
|
71 | 70 | {{#is assertion 'assert'}} |
72 | 71 | assert.true(validator.validate(res.body, schema)); |
73 | 72 | {{/is}} |
74 | | - done(); |
75 | | - {{/isJsonMediaType}} |
76 | | - {{#isXmlMediaType returnType}} |
77 | | - var xml2jsConfig = {{xml2jsConfig}}; |
78 | | - |
79 | | - parseString(res.text, xml2jsConfig, function(parseErr, result) { |
80 | | - if (parseErr) return done(parseErr); |
81 | | - {{#is assertion 'expect'}} |
82 | | - expect(validator.validate(result, schema)).to.be.true; |
83 | | - {{/is}} |
84 | | - {{#is assertion 'should'}} |
85 | | - validator.validate(result, schema).should.be.true; |
86 | | - {{/is}} |
87 | | - {{#is assertion 'assert'}} |
88 | | - assert.true(validator.validate(result, schema)); |
89 | | - {{/is}} |
90 | | - done(); |
91 | | - }); |
92 | | - {{/isXmlMediaType}} |
93 | 73 | {{else}} |
94 | 74 | {{#isPdfMediaType returnType}} |
95 | 75 | {{#is assertion 'expect'}} |
|
112 | 92 | assert.isNull(res.body); // non-json response or no schema |
113 | 93 | {{/is}} |
114 | 94 | {{/isPdfMediaType}} |
115 | | - done(); |
116 | 95 | {{/validateResponse}} |
| 96 | + done(); |
117 | 97 | }); |
118 | 98 | }); |
119 | 99 | {{#if isLoadTest}} |
|
147 | 127 | {{#is contentType 'application/json'}} |
148 | 128 | .send({ |
149 | 129 | {{#each bodyParameters}} |
150 | | - '{{this.name}}': 'DATA GOES HERE'{{#unless @last}},{{/unless}} |
| 130 | + '{{this.name}}': {{requestDataParamFormatter this.name 'string' ../requestParameters}}{{#unless @last}},{{/unless}} |
151 | 131 | {{/each}} |
152 | 132 | }) |
153 | 133 | {{/is}} |
|
0 commit comments