-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
411289d
commit e149c8d
Showing
6 changed files
with
327 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
meta { | ||
name: supermetrics json visualize | ||
type: http | ||
seq: 5 | ||
} | ||
|
||
post { | ||
url: https://testbench-sanity.usebruno.com/api/echo/json | ||
body: json | ||
auth: none | ||
} | ||
|
||
headers { | ||
foo: bar | ||
} | ||
|
||
auth:basic { | ||
username: asd | ||
password: j | ||
} | ||
|
||
auth:bearer { | ||
token: | ||
} | ||
|
||
body:json { | ||
{ | ||
"notes": { | ||
"runtime_sec": 5, | ||
"result_rows": 4, | ||
"query_count": 6 | ||
}, | ||
"fields": [ | ||
{ | ||
"name": "Count", | ||
"type": "number", | ||
"data_type": "number" | ||
}, | ||
{ | ||
"name": "Name", | ||
"type": "string", | ||
"data_type": "string" | ||
}, | ||
{ | ||
"name": "Age", | ||
"type": "number", | ||
"data_type": "number" | ||
}, | ||
{ | ||
"name": "Email", | ||
"type": "email", | ||
"data_type": "string" | ||
}, | ||
{ | ||
"name": "Place", | ||
"type": "string", | ||
"data_type": "string" | ||
} | ||
], | ||
"data": [ | ||
{ | ||
"id": null, | ||
"name": "Name", | ||
"age": "Age", | ||
"email": "Email", | ||
"city": "City" | ||
}, | ||
{ | ||
"id": 1, | ||
"name": "John Doe", | ||
"age": 30, | ||
"email": "[email protected]", | ||
"city": "New York" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Jane Smith", | ||
"age": 25, | ||
"email": "[email protected]", | ||
"city": "Los Angeles" | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "Bob Johnson", | ||
"age": 35, | ||
"email": "[email protected]", | ||
"city": "Chicago" | ||
}, | ||
{ | ||
"id": 4, | ||
"name": "Alice Williams", | ||
"age": 28, | ||
"email": "[email protected]", | ||
"city": "San Francisco" | ||
} | ||
] | ||
} | ||
|
||
} | ||
|
||
assert { | ||
res.status: eq 200 | ||
} | ||
|
||
script:pre-request { | ||
const { URL } = require('url'); | ||
|
||
const reqUrl = new URL(req.url); | ||
|
||
reqUrl.searchParams.delete('returnQueryIDafterSeconds'); | ||
reqUrl.searchParams.delete('separateFetchQuery'); | ||
reqUrl.searchParams.delete('pretty'); | ||
reqUrl.searchParams.delete('displayLog'); | ||
reqUrl.searchParams.delete('triggerID'); | ||
reqUrl.searchParams.delete('hashForQIDFDB'); | ||
reqUrl.searchParams.delete('queryType'); | ||
reqUrl.searchParams.delete('queryCount'); | ||
|
||
reqUrl.searchParams.append("cacheBuster", new Date().toISOString()); | ||
|
||
req.setUrl(reqUrl.href); | ||
|
||
} | ||
|
||
script:post-response { | ||
const visualizeNotes = require("./lib/notes"); | ||
|
||
bru.visualize(visualizeNotes(res)); | ||
} | ||
|
||
tests { | ||
test("should return json", function() { | ||
const data = res.getBody(); | ||
expect(res.getBody()).to.eql({ | ||
"hello": "bruno" | ||
}); | ||
}); | ||
|
||
} |
Oops, something went wrong.