Skip to content

Commit b7f0f07

Browse files
committed
test: cover new response header and body assertion steps
Add three scenarios to features/test.feature: - Response header assertion with explicit Content-Type - Response body is not empty - Response body matches a regular expression Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 82dea2e commit b7f0f07

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

features/test.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,27 @@ Feature: Test this extension
315315
Scenario: Wait for seconds
316316
When wait for 1 seconds
317317
When past 1 second since wait step
318+
319+
Scenario: Test response header assertion matches expected value
320+
When set the response with "Content-Type" header "application/json" to:
321+
"""
322+
{"ok":true}
323+
"""
324+
And sending "POST" to "/"
325+
Then the response header "Content-Type" should contain "application/json"
326+
327+
Scenario: Test response body is not empty
328+
When set the response to:
329+
"""
330+
hello
331+
"""
332+
And sending "POST" to "/"
333+
Then the response body should not be empty
334+
335+
Scenario: Test response body matches a regular expression
336+
When set the response to:
337+
"""
338+
%PDF-1.4 binary content here
339+
"""
340+
And sending "POST" to "/"
341+
Then the response body should match the regular expression "^%PDF"

0 commit comments

Comments
 (0)